Refactored route factory