refactored the notification system