Refactor event classes to use with shared pointers.