refactor route-matching strategies

@cordoval this was just a refactor, no altered behavior, so the idea was the existing tests should cover.