the `addAlert` method feels too big. I would probably break it into 4-5 different methods.. every block of code is doing a different thing and could be a private method with a single responsibility. would make it easier to scan the method quickly and would reduce the need of comments.