   }
 }
 
+/**
+ * MQTT Connection event handler.
+ *
+ * Subscribes to desired channels
+ */
 void mqttConnected(void* response) {
   if (Debugging) {
     debugger.println("MQTT Connected");
   }
+  
+  // Subscribe to time beacon channel to keep RTC up to date.
   mqtt.subscribe(sTime);
+  
+  // Subscribe to remote trigger channel to allow remote control of chicken coop
   mqtt.subscribe(sRemote);
 }
 
+/**
+ * MQTT Disconnect event handler.
+ */
 void mqttDisconnected(void* response) {
   if (Debugging) {
     debugger.println("MQTT Disconnected");
   }
 }
 
-void mqttPublished(void* response) {}
-
+/**
+ * MQTT Publish even handler.
+ *
+ * We don't really need this, but it allows logging of any sent
+ * messages for debugging purposes.
+ */
+void mqttPublished(void* response) {
+  RESPONSE res(response);
+  String topic = res.popString();
+  String data  = res.popString();
+  if (Debugging) {
+    debugger.print("MQTT Data published to channel '");
+    debugger.print(topic);
+    debugger.print("': ");
+    debugger.println(data);
+  }
+}
+
+/**
+ * Handle incoming MQTT messages.
+ *
+ * This allows us to remotely trigger events via WIFI!
+ */
 void mqttData(void* response) {
   RESPONSE res(response);
   String topic = res.popString();

  pinMode(doorBottom, INPUT);
  pinMode(fan, OUTPUT);
  pinMode(fanSpeed, OUTPUT);
  pinMode(lcd_bl, OUTPUT);
  
  // Pin defaults
  digitalWrite(lampRelay, LOW);

MQTT mqtt(&esp);
boolean wifiConnected = false;

/**
 * Manage WIFI connection
 */
void wifiCb(void* response) {
  uint32_t status;
  RESPONSE res(response);
