refactored notification message logic
updated version