     
     private func propertyNames() -> NSArray {
         var reference: AnyClass = self.superclass!
-        var properties = NSMutableSet.new()
-        var resolved = false
+        let properties = NSMutableSet.new()
         
         properties.addObjectsFromArray(propertyNamesForClass(self.classForCoder) as [AnyObject])
         
-        while resolved != true {
+        while reference.superclass() != nil {
             properties.addObjectsFromArray(propertyNamesForClass(reference) as [AnyObject])
-            
-            if reference.superclass() != nil {
-                reference = reference.superclass()!
-            } else {
-                resolved = true
-            }
+            reference = reference.superclass()!
         }
         
         return properties.allObjects
     }
     
-    private func propertyTypesForClass(aClass: AnyClass?) -> NSDictionary {
+    private func propertyTypesForClass(aClass: AnyClass?) -> Dictionary<String, String> {
         var propertyCount: UInt32 = 0
-        var propertyList = class_copyPropertyList(aClass, &propertyCount)
-        var propertyTypes = NSMutableDictionary.new()
-        var i: UInt32
-        
-        let cleanupSet = NSCharacterSet.init(charactersInString: "\"@")
-        
-        for (i = 0; i < propertyCount; i++) {
+        let propertyList = class_copyPropertyList(aClass, &propertyCount)
+        let propertyTypes = NSMutableDictionary.new()
+        let cleanupSet = NSCharacterSet.init(charactersInString: "\"@(){}")
+
+        for (var i: UInt32 = 0; i < propertyCount; i++) {
             let property: objc_property_t = propertyList[Int(i)]
             let propertyName = NSString(UTF8String: property_getName(property))
             let propertyAttributes = NSString(UTF8String: property_getAttributes(property))

    
    private func propertyNamesForClass(aClass: AnyClass?) -> NSArray {
        var propertyCount: UInt32 = 0
        var propertyList = class_copyPropertyList(aClass, &propertyCount)
        var properties = NSMutableSet.new()
        var i: UInt32
        
        for (i = 0; i < propertyCount; i++) {
            let property: objc_property_t = propertyList[Int(i)]
            let propertyName = NSString(UTF8String: property_getName(property))
            

            if propertyType?.length > 1 {
                var cleanType: AnyObject = propertyType!.componentsSeparatedByCharactersInSet(cleanupSet)
                propertyType = cleanType.componentsJoinedByString("")
            } else {
                switch propertyType as! String {
                case "B":
                    propertyType = "NSNumber"
                    break
                default:
                    break
                }
            }
            
            propertyTypes["\(propertyName!)"] = "\(propertyType!)"
        }
        
        return propertyTypes.copy() as! Dictionary
    }

    func propertyTypes() -> NSDictionary {
        var reference: AnyClass = self.superclass!
        let mutableDictionary = NSMutableDictionary.new()
        mutableDictionary.addEntriesFromDictionary(propertyTypesForClass(self.classForCoder))
        
        while reference.superclass() != nil {
            mutableDictionary.addEntriesFromDictionary(propertyTypesForClass(reference))
            reference = reference.superclass()!
        }
        
        return mutableDictionary.copy() as! NSDictionary
    }

    class func initWithDictionary(dictionary :NSDictionary) -> Self? {
