Refactor to ObserverPattern