Changed to the observer pattern