 /// - Throws: Error information, if an error occurred.
 /// - Returns: Array  of contacts
 public func fetchContacts(withContainerIdentifier containerIdentifier: String, keysToFetch: [CNKeyDescriptor] = [CNContactVCardSerialization.descriptorForRequiredKeys()]) throws -> [CNContact] {
-    return try CNContactStore().unifiedContacts(matching: CNContact.predicateForContactsInContainer(withIdentifier: containerIdentifier), keysToFetch: keysToFetch)
+    return try ContactStore.default.unifiedContacts(matching: CNContact.predicateForContactsInContainer(withIdentifier: containerIdentifier), keysToFetch: keysToFetch)
 }
+
+/// Fetch a  contact with a given identifier.
+/// - Parameters:
+///   - identifier: The identifier of the contact to fetch.
+///   - keysToFetch: The contact fetch request that specifies the search criteria.
+/// - Throws: Error information, if an error occurred.
+/// - Returns: Contact matching or linked to the identifier
+private func fetchContact(withIdentifier identifier: String, keysToFetch: [CNKeyDescriptor] = [CNContactVCardSerialization.descriptorForRequiredKeys()]) throws -> CNContact {
+    return try ContactStore.default.unifiedContact(withIdentifier: identifier, keysToFetch: keysToFetch)
+}

            let fetchRequest = CNContactFetchRequest(keysToFetch: keysToFetch)
            fetchRequest.unifyResults = unifyResults
            fetchRequest.sortOrder = order
            try CNContactStore().enumerateContacts(with: fetchRequest) { contact, _ in
                contacts.append(contact)
            }
            continuation.resume(returning: contacts)

/// - Throws: Error information, if an error occurred.
/// - Returns: Array  of contacts
public func fetchContacts(withGroupIdentifier groupIdentifier: String, keysToFetch: [CNKeyDescriptor] = [CNContactVCardSerialization.descriptorForRequiredKeys()]) throws -> [CNContact] {
    return try ContactStore.default.unifiedContacts(matching: CNContact.predicateForContactsInGroup(withIdentifier: groupIdentifier), keysToFetch: keysToFetch)
}

/// find the contacts in the specified container.
