Cleaned up some duplication between client_base, consumer, and producer