refactor routes.js