refactored alerts to use a service