  * @brief Bootstrap function for the MQTT connection
  */
 void setupMQTT() {
-  mqtt.onConnect([](bool sessionPresent) { onMQTTConnect(); });
-
-  mqtt.onDisconnect(
-      [](AsyncMqttClientDisconnectReason reason) { onMQTTDisconnect(); });
-
-  mqtt.onMessage([](char *topic, char *payload,
-                    AsyncMqttClientMessageProperties properties, size_t len,
-                    size_t index,
-                    size_t total) { onMQTTMessage(topic, payload, len); });
+  mqtt.onConnect(onMQTTConnect);
+  mqtt.onDisconnect(onMQTTDisconnect);
+  mqtt.onMessage(onMQTTMessage);
 }
 
 /**

 *
 * @param topic the MQTT topic to which the message has been published
 * @param payload the contents/message that has been published
 * @param length size of the published message
 */
void onMQTTMessage(char *topic, char *payload, uint16_t length) {
  // Convert payload into char variable
  char message[length + 1];
  os_memcpy(message, payload, length);


/**
 * @brief Event handler for when a connection to the MQTT has been established.
 *
 * @param bool sessionPresent
 */
void onMQTTConnect(bool sessionPresent) {
  DEBUGLOG("[MQTT] Connected\n");

  // Notify subscribers (connected)
