Refactor mqtt to use new adaptor interface