Refactor and improve broker base class