factor initRoutes from Router