#35: Fixed unique alert messages, refactored code