refactor event