refactor alert service