Refactored out the event factory.