[CHORE] Refactoring and commenting notifications code