private function makeCallable($state) : callable
    {
        if (is_callable($state)) {
            return $state;
        }
        return function () use ($state) {
            if (is_string($state) && class_exists($state)) {
                $state = new $state;
            }
            return $state;
        };
    }