Refactor mosquitto repo