refactor control