Refactoring controllers