updated to use Observer pattern to handle data update