notification setup with some refactoring