refactoring notifier logic