improved observerPattern