refactored routes to keep them dry