refactor alert module