Minor routes.js refactoring