refactoring spacecontrol