Event refactoring and further edit_box work