Updated for the observer pattern