public function resolve(string $path): IEngine
    {
        if ($this->cache === null) {
            $this->cache = [];
            foreach ($this->engines as $engine) {
                $this->cache[] = $engine[0]($this->renderer);
            }
        }

        foreach ($this->cache as $engine) {
            if ($engine->canHandle($path)) {
                return $engine;
            }
        }

        return $this->renderer->getDefaultEngine();
    }