abstracted away showAlert() to a factory