extracted the logic about showing notifications in a separate class