Optimzized sitemap_routes function.