The readwritesplit transaction management was a large part of the clientReply function. Moving it into a separate function clarifies the clientReply function by hiding the comments and details of the transaction management.