public function in(array $dirs, $reset = false)
    {
        $reset and $this->dirs = [];
        array_walk($dirs, function ($dir, $name) {
            if (! is_dir($dir)) {
                throw new InvalidArgumentException('Template folders must be readable paths.');
            }
            if (! is_string($name)) {
                $norm = explode(DIRECTORY_SEPARATOR, $this->normalize($dir));
                $name = implode('.', array_slice($norm, -2));
            }
            $this->dirs[$name] = $dir;
        });
    }