more alerts refactor and fix