Notification pull backend: unit tests and refactoring