Refactor .alerts class