Refactoring front end controller