refactored httprouter parser to be in 2 steps