public function resolve(Request $request, Response $response)
    {
        $uriPath = $this->calledUri->path($this->route->configuredPath());
        $target  = $this->route->target();
        if (is_callable($target)) {
            return $target($request, $response, $uriPath);
        }

        if ($target instanceof Target) {
            return $target->resolve($request, $response, $uriPath);
        }

        $targetInstance = $this->injector->getInstance($target);
        if (!($targetInstance instanceof Target)) {
            return $response->internalServerError(
                    'Configured target class ' . $target . ' for route ' . $uriPath
                    . ' is not an instance of ' . Target::class
            );
        }

        return $targetInstance->resolve($request, $response, $uriPath);
    }