         return true
     }
     
-    public func equals(rhs: MixpanelType) -> Bool {
-        if rhs is [String: MixpanelType] {
-            let rhs = rhs as! [String: MixpanelType]
-            
-            if self.keys.count != rhs.keys.count {
-                return false
-            }
-            
-            if !isValidNestedTypeAndValue() {
-                return false
-            }
-            
-            for (key, val) in self as! [String: MixpanelType] {
-                guard let rVal = rhs[key] else {
-                    return false
-                }
-
-                if !val.equals(rhs: rVal) {
-                    return false
-                }
-            }
-            return true
-        }
-        return false
-    }
+    public func equals(rhs: MixpanelType?) -> Bool {
+        dictionaryEquals(lhs: self as! [String : MixpanelType], rhs: rhs)
+    }
+}
+
+func dictionaryEquals(lhs: [String : MixpanelType], rhs: MixpanelType) -> Bool {
+    if rhs is [String: MixpanelType] {
+        let rhs = rhs as! [String: MixpanelType]
+        
+        if lhs.keys.count != rhs.keys.count {
+            return false
+        }
+        
+        if !lhs.isValidNestedTypeAndValue() {
+            return false
+        }
+        
+        for (key, val) in lhs {
+            guard let rVal = rhs[key] else {
+                return false
+            }
+
+            if !val.equals(rhs: rVal) {
+                return false
+            }
+        }
+        return true
+    }
+    return false
 }
 
 func assertPropertyTypes(_ properties: Properties?) {

     */
    public func isValidNestedTypeAndValue() -> Bool { return true }
    
    public func equals(rhs: MixpanelType) -> Bool {
        if rhs is String {
            return self == rhs as! String
        }

     */
    public func isValidNestedTypeAndValue() -> Bool { return true }

    public func equals(rhs: MixpanelType?) -> Bool {
        if rhs is URL {
            return self == rhs as! URL
        }
