event dispatcher as an optional dependency