refactored notification method