refactoring & fix event propagation problem