public function load (string $name) : TemplateInterface
    {
        $supportedExtensions = array_keys(self::$providers);

        $fsPathLength = strlen($this->fs->path());

        $files = $this->fs
            ->find("{$name}.*")
            ->files()
            ->asArray();

        $found = [];
        foreach ($files as $file) {
            $ext = $file->extension();
            if (!in_array($ext, $supportedExtensions))
                continue;
            $found[] = [
                'name' => substr($file->path(), $fsPathLength),
                'extension' => $ext
            ];
        }

        if (count($found) == 0) {
            throw new \InvalidArgumentException("Unable to find template with name '{$name}' on '{$this->fs->path()}'");
        }

        if (count($found) > 1) {
            throw new \InvalidArgumentException("Mutiple templates found for the name '{$name}' on '{$this->fs->path()}'");
        }

        return $this->loaders[$found[0]['extension']]->load($found[0]['name']);
    }