refactor event schema