Refactoring on router and controllers.