public function replaceEventHandler($event, callable $delegate)
    {
        if (isset($this->eventHandlers[$event])) {
            $this->eventHandlers[$event] = [];
        }

        $this->attachEventHandler($event, $delegate);
    }