refactoring
better event cycle
refactoring