refactor event spec