A little refactoring to routes.js