Add observer design pattern to the model and view