This and all of the sender related code below is a lot of duplication of what's in the client package. There's nothing fixed w.r.t. the client package implementation and/or design... seems like we should be able to find a way to change client so that we don't have all the duplication?