refactor event model