refactoring all of controller