small refactoring on the routes