created some new classes to encapsulate outbound rewriting logic