refactor router.js: make only one method call