     }
     
     internal func remove(key: String) throws {
-        let query = KeychainService.keychainQuery(withService: service,
-                                                  account: key,
-                                                  accessGroup: accessGroup)
+        let query = keychainQuery(forKey: key)
         let status = SecItemDelete(query as CFDictionary)
         if status != errSecSuccess && status != errSecItemNotFound {
             debugPrint("delete: \(status)")

        
        try remove(key: key)
        
        var query = KeychainService.keychainQuery(withService: service,
                                                  account: key,
                                                  accessGroup: accessGroup)
        
        query[kSecUseAuthenticationUI as String] = kSecUseAuthenticationUIFail
        

        }
    }
    
    private func keychainQuery(forKey key: String? = nil) -> [String : Any] {
        var query = [String : Any]()
        query[kSecClass as String] = kSecClassGenericPassword
        query[kSecAttrService as String] = service
        
        if let account = key {
            query[kSecAttrAccount as String] = account
        }
        
