made the dependency on an event dispatcher optional