Major refactoring and Broker/PDP integration