Refactoring the router logic a little more to be dry.