refactored message sending and Broker,Client,Worker classes