Support enabling/disabling alerting.
Remove duplication.