protected function findTemplate($text)
    {
        $matchedTemplate = [];
        $maxMatch = -1;

        foreach ($this->directoryIterator as $fileInfo) {
            $templateContent = file_get_contents($fileInfo->getPathname());

            similar_text($text, $templateContent,
                $matchPercentage); //Compare template against text to decide on similarity percentage

            if ($matchPercentage > $maxMatch) {
                $this->logger->debug(sprintf('Template "%s" is a best match for now', $fileInfo->getPathname()));

                $maxMatch = $matchPercentage;
                $matchedTemplate = [$fileInfo->getPathname() => $templateContent];
            }
        }

        return $matchedTemplate;
    }