Refactor the routes.