i think we should consider pushing this into the transport layer so that we can optimize this there.