observer substituted with events and layerdiagram