write functions to parse event objects