Adding the observer pattern