refactoring
add exit event
refactoring
refactoring