Refactored Observer pattern