Refactoring routes to use module pattern