Feature #65, refactoring controllers, middlewares and services