Refactor: improve work with notifications.