Finish dealing with events

From #6359.
This PR looks good, can we remove this function since this was the only place it was used?