Refactor callAlert