Refactoring the controller to sevral controllers