Refactor to make a typed AlertType.