Refactored matching routes into a URLMatcher class