(refactor) simplify route addition logic

Condense route addition logic and remove code duplication.