Extract route processors to a library to clean up code and make them testable