Replaced generateRoutes to new generating.