continue refactoring router.js