Refactor event class