         case unhandledError(status: OSStatus)
     }
 
-    fileprivate func commonConfigurationDictionary(forEntry entry:String) -> [String : AnyObject] {
+    fileprivate func commonConfigurationDictionary(forKey key:String) -> [String : AnyObject] {
         return [
             kSecClass as String : kSecClassGenericPassword,
             kSecAttrService as String : Bundle.main.bundleIdentifier as AnyObject,
-            kSecAttrGeneric as String : entry as AnyObject,
-            kSecAttrAccount as String : entry as AnyObject
+            kSecAttrGeneric as String : key as AnyObject,
+            kSecAttrAccount as String : key as AnyObject
         ]
     }
 
-    fileprivate func getValue(forEntry entry:String) throws -> String {
-        var query = commonConfigurationDictionary(forEntry: entry)
+    fileprivate func getValue(forKey key:String) throws -> String {
+        var query = commonConfigurationDictionary(forKey: key)
         query[kSecMatchLimit as String] = kSecMatchLimitOne
         query[kSecReturnData as String] = kCFBooleanTrue
         

    public var password: String? {
        get {
            do {
                return try getValue(forEntry: passwordKey)
            } catch  {
                return nil
            }
        }
        set(newPassword) {
            do {
                return try set(value: newPassword, forEntry: passwordKey)
            } catch  {
                assert(false, "\(error)")
            }

        return value
    }
    
    fileprivate func deleteValue(forKey key:String) throws {
        let query = commonConfigurationDictionary(forKey: key)
        let status = SecItemDelete(query as CFDictionary)
        guard status == noErr || status == errSecItemNotFound else { throw WMFKeychainCredentialsError.unhandledError(status: status) }
    }
    
    fileprivate func set(value:String?, forKey key:String) throws {
        // nil value causes the key/value pair to be removed from the keychain
        guard let value = value else {
            do {
                try deleteValue(forKey: key)
            } catch  {
                throw WMFKeychainCredentialsError.couldNotDeleteData
            }
            return
        }
        
        var query = commonConfigurationDictionary(forKey: key)
        let valueData = value.data(using: String.Encoding.utf8)!
        query[kSecValueData as String] = valueData as AnyObject?
        query[kSecAttrAccessible as String] = kSecAttrAccessibleWhenUnlocked
