protected function withAddedStep(string $stage, callable $step, bool $replace = false)
    {
        $clone = clone $this;

        if ($replace) {
            $clone->stages[$stage] = [];
        }

        $clone->stages[$stage][] = $step;

        return $clone;
    }