generate_routes! into smaller methods