-                       break;\r
-               case WEBSERVER_STATE_SendResponseHeader:\r
-                       /* Determine what HTTP header should be sent to the client */\r
-                       if (AppState->FileOpen)\r
-                       {\r
-                               AppDataSize = strlen_P(HTTP200Header);\r
-                               strncpy_P(AppData, HTTP200Header, AppDataSize);\r
-                       }\r
-                       else\r
-                       {\r
-                               AppDataSize = strlen_P(HTTP404Header);\r
-                               strncpy_P(AppData, HTTP404Header, AppDataSize);\r
-                       }\r
-                       \r
-                       uip_send(AppData, AppDataSize);\r
-                       \r
-                       AppState->CurrentState = WEBSERVER_STATE_SendMIMETypeHeader;\r
-                       break;\r
-               case WEBSERVER_STATE_SendMIMETypeHeader:\r
-                       /* File must have been found and opened for MIME header to be sent */\r
-                       if (AppState->FileOpen)\r
-                       {\r
-                               char* Extension = strpbrk(AppState->FileName, ".");\r
-                               \r
-                               /* Check to see if a file extension was found for the requested filename */\r
-                               if (Extension != NULL)\r
-                               {\r
-                                       /* Look through the MIME type list, copy over the required MIME type if found */\r
-                                       for (int i = 0; i < (sizeof(MIMETypes) / sizeof(MIMETypes[0])); i++)\r
-                                       {\r
-                                               if (strcmp_P(&Extension[1], MIMETypes[i].Extension) == 0)\r
-                                               {\r
-                                                       AppDataSize = strlen_P(MIMETypes[i].MIMEType);\r
-                                                       strncpy_P(AppData, MIMETypes[i].MIMEType, AppDataSize);                                         \r
-                                                       break;\r
-                                               }\r
-                                       } \r
-                               }\r
-\r
-                               /* Check if a MIME type was found and copied to the output buffer */\r
-                               if (!(AppDataSize))\r
-                               {\r
-                                       /* MIME type not found - copy over the default MIME type */\r
-                                       AppDataSize = strlen_P(DefaultMIMEType);\r
-                                       strncpy_P(AppData, DefaultMIMEType, AppDataSize);                               \r
-                               }\r
-                               \r
-                               /* Add the end-of line terminator and end-of-headers terminator after the MIME type */\r
-                               strncpy(&AppData[AppDataSize], "\r\n\r\n", sizeof("\r\n\r\n"));\r
-                               AppDataSize += (sizeof("\r\n\r\n") - 1);\r
-                               \r
-                               uip_send(AppData, AppDataSize);\r
-                       }\r
-                               \r
-                       AppState->CurrentState = WEBSERVER_STATE_SendData;                              \r
-                       break;\r
-               case WEBSERVER_STATE_SendData:\r
-                       /* If end of file/file not open, progress to the close state */\r
-                       if (!(AppState->FileOpen))\r
+/** HTTP Server State handler for the MIME Header Send state. This state manages the transmission of the file\r
+ *  MIME type header for the requested file to the receiving HTTP client.\r
+ */\r
+static void HTTPServerApp_SendMIMETypeHeader(void)\r
+{\r
+       uip_tcp_appstate_t* const AppState    = &uip_conn->appstate;\r
+       char*               const AppData     = (char*)uip_appdata;\r
+\r
+       char*    Extension        = strpbrk(AppState->HTTPServer.FileName, ".");\r
+       uint16_t MIMEHeaderLength = 0;\r
+\r
+       /* Check to see if a file extension was found for the requested filename */\r
+       if (Extension != NULL)\r
+       {\r
+               /* Look through the MIME type list, copy over the required MIME type if found */\r
+               for (int i = 0; i < (sizeof(MIMETypes) / sizeof(MIMETypes[0])); i++)\r
+               {\r
+                       if (strcmp_P(&Extension[1], MIMETypes[i].Extension) == 0)\r