added logger
added observer pattern