Refactor signal connection handling in EventDispatcher