Tidied up some of the events stuff