         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 basicDictionary() -> [String: AnyObject] {
        
        let serviceName = NSBundle(forClass: self).infoDictionary![kCFBundleIdentifierKey] as! String
        
        return [kSecClass as String : kSecClassGenericPassword, kSecAttrService as String : serviceName]
    }

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