restructuring of remctl code and interface