router.js: improving dictionary use