refactor the extendEventData method