Refactored Broker and added leave method