             return
         }
 
-#if os(Linux)  
-        let contentTypesData = contentTypesString.bridge().dataUsingEncoding(NSUTF8StringEncoding)
-#else
-        let contentTypesData = contentTypesString.bridge().data(usingEncoding: NSUTF8StringEncoding)
-#endif
-
-        if contentTypesData == nil {
+#if os(Linux)
+        guard let contentTypesData = contentTypesString.bridge().dataUsingEncoding(NSUTF8StringEncoding) else {
             Log.error("Error parsing \(contentTypesString)")
             return
         }
+#else
+        guard let contentTypesData = contentTypesString.bridge().data(usingEncoding: NSUTF8StringEncoding) else {
+            Log.error("Error parsing \(contentTypesString)")
+            return
+        }
+#endif
 
         // MARK: Linux Foundation will return an Any instead of an AnyObject
         // Need to test if this breaks the Linux build.
-#if os(Linux)  
-        let jsonData = try? NSJSONSerialization.JSONObjectWithData(contentTypesData!,
-            options: NSJSONReadingOptions.MutableContainers) as? NSDictionary 
-#else
-        let jsonData = try? NSJSONSerialization.jsonObject(with: contentTypesData!, 
-            options: NSJSONReadingOptions.mutableContainers) as? NSDictionary
-#endif
-            
-
-        if jsonData == nil || jsonData! == nil {
+#if os(Linux)
+        guard let parsedObject = try? NSJSONSerialization.JSONObjectWithData(contentTypesData,
+            options: NSJSONReadingOptions.MutableContainers) else {
+                Log.error("JSON could not be parsed")
+                return
+            }
+#else
+        guard let parsedObject = try? NSJSONSerialization.jsonObject(with: contentTypesData,
+            options: NSJSONReadingOptions.mutableContainers) else {
+                Log.error("JSON could not be parsed")
+                return
+            }
+#endif
+
+        // Should be moved to single guard statement with parsedObject
+        // when Linux Api is updated
+        guard let jsonData = parsedObject as? [String : [String]] else {
             Log.error("JSON could not be parsed")
             return
         }
 
-        for (contentType, exts) in jsonData!! {
-
-            let e = exts as! [String]
-            for ext in e {
-
-                extToContentType[ext] = contentType as? String
-
+        for (contentType, exts) in jsonData {
+            for ext in exts {
+                extToContentType[ext] = contentType
             }
         }
     }

    public func isType (messageContentType: String, typeDescriptor: String) -> Bool {

        let type = typeDescriptor.lowercased()
#if os(Linux)  
        let typeAndSubtype = messageContentType.bridge().componentsSeparatedByString(";")[0].lowercased()
#else
        let typeAndSubtype = messageContentType.componentsSeparated(by: ";")[0].lowercased()

    /// Shared singleton instance
    ///
    public static let sharedInstance = ContentType()

    ///
    /// The following function loads the MIME types from an external file
    ///
