refactored 3 notify code duplicates to a method