             
             switch itemClass {
             case .GenericPassword:
-                if let service = attributes[kSecAttrService as String] as? String {
+                if let service = attributes[AttributeService] as? String {
                     item["service"] = service
                 }
-                if let accessGroup = attributes[kSecAttrAccessGroup as String] as? String {
+                if let accessGroup = attributes[AttributeAccessGroup] as? String {
                     item["accessGroup"] = accessGroup
                 }
             case .InternetPassword:
-                if let server = attributes[kSecAttrServer as String] as? String {
+                if let server = attributes[AttributeServer] as? String {
                     item["server"] = server
                 }
-                if let proto = attributes[kSecAttrProtocol as String] as? String {
+                if let proto = attributes[AttributeProtocol] as? String {
                     if let protocolType = ProtocolType(rawValue: proto) {
                         item["protocol"] = protocolType.description
                     }
                 }
-                if let auth = attributes[kSecAttrAuthenticationType as String] as? String {
+                if let auth = attributes[AttributeAuthenticationType] as? String {
                     if let authenticationType = AuthenticationType(rawValue: auth) {
                         item["authenticationType"] = authenticationType.description
                     }
                 }
             }
             
-            if let key = attributes[kSecAttrAccount as String] as? String {
+            if let key = attributes[AttributeAccount] as? String {
                 item["key"] = key
             }
-            if let data = attributes[kSecValueData as String] as? NSData {
+            if let data = attributes[ValueData] as? NSData {
                 if let text = NSString(data: data, encoding: NSUTF8StringEncoding) as? String {
                     item["value"] = text
                 } else  {

    public func removeAll() throws {
        var query = options.query()
        #if !os(iOS) && !os(watchOS)
        query[kSecMatchLimit as String] = kSecMatchLimitAll
        #endif
        
        let status = SecItemDelete(query)

        
        if key != nil {
            attributes = query()
            attributes[AttributeAccount] = key
        } else {
            attributes = [String: AnyObject]()
        }
        
        attributes[ValueData] = value
        
        if label != nil {
            attributes[AttributeLabel] = label
        }
        if comment != nil {
            attributes[AttributeComment] = comment
        }

        if let policy = authenticationPolicy {
