Refactoring controller and forms