broker refactor