router.js cleaned up