Refactor NotificationHandler.