control refactoring