refactored alerts to be more modular