Made some changes to the MessageBroker logic.
- Avoid closures
- Don't keep working if the broker was disposed.