refactor event: edit, delete