Refactor trp_route_encoders for better style