Adding tests for notification plus refactoring.