Refactor MessageBroker to be more readable
Add automatic cleanup functionality