refactored routing for custom routes