Refactor the alert messages