refacto class Alert()