Refactor alerts.