         searchDictionary[kSecMatchLimit as String] = kSecMatchLimitOne
         searchDictionary[kSecReturnData as String] = kCFBooleanTrue
         
-        var dataTypeRef: Unmanaged<AnyObject>?
-
-        let status = SecItemCopyMatching(searchDictionary as CFDictionaryRef, &dataTypeRef)
+        var retrievedData: AnyObject?
+        let status = SecItemCopyMatching(searchDictionary as CFDictionaryRef, &retrievedData)
         
         var data: NSData?
         if status == errSecSuccess {
-            data = dataTypeRef!.takeRetainedValue() as? NSData
+            data = retrievedData as? NSData
         }
         
         return data

    
    private class func update(value: String, forKey key: String) -> Bool {
        
        var searchDictionary = newSearchDictionary(forKey: key)
        var updateDictionary = [String: AnyObject]()
        
        updateDictionary[kSecValueData as String] = value.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)

    }
    
    private class func deleteValue(forKey key: String) -> Bool {
        let searchDictionary = newSearchDictionary(forKey: key)
        let status = SecItemDelete(searchDictionary)
        
        return status == errSecSuccess
