Thread notification refactoring