               let features = detector.features(in: ciImage) as? [CIQRCodeFeature],
               let messageString = features.first?.messageString else {
 
-            let alertController = UIAlertController(title: "Could Not Detect QR Code",
-                                                    message: "No QR code was detected in the provided image. Please try importing a different image.",
-                                                    preferredStyle: .alert)
-            alertController.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))
-            self.present(alertController, animated: true, completion: nil)
+            presentErrorAlert(title: "Could Not Detect QR Code",
+                              message: "No QR code was detected in the provided image. Please try importing a different image.")
             return
         }
 
         guard let qrCodeURL = URL(string: messageString),
               let account = Account(url: qrCodeURL) else {
 
-            let alertController = UIAlertController(title: "Invalid QR Code",
-                                                    message: "The QR code detected in the provided image is invalid. Please try a different image.",
-                                                    preferredStyle: .alert)
-            alertController.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))
-            self.present(alertController, animated: true, completion: nil)
+            presentErrorAlert(title: "Invalid QR Code",
+                              message: "The QR code detected in the provided image is invalid. Please try a different image.")
             return
         }
 

            cell.copy(self)
        }
    }
}

extension AccountsViewController: UISearchResultsUpdating {


                self.present(imagePickerController, animated: true, completion: nil)
            } else {
                presentErrorAlert(title: "Photo Library Empty",
                                  message: "The photo library is empty and there are no images to import.")
            }
        }

