Example of observer design pattern