Refactored broker code, fixed bug