Refactoring of Routing and Controller