controllers refactoring