improve observer pattern