refactored routing