first version of integration with broker. Testing is needed.