minor refactor of events_to_dict in prep for performance improvement
optimize some uses of events_to_dict