protected function searchPluginFactoryClass($pluginDirectory) {
        foreach ($this->internalPluginStructure as $pluginStructure) {
            $path = $pluginDirectory.'/'.$pluginStructure.'/';
            if ( ($directoryHandle = opendir($path)) == true ) {
                while (($fileOrDir = readdir( $directoryHandle )) !== false) {
                    if (is_file($path. $fileOrDir) && $this->isPhpFile($path.$fileOrDir)) {
                        $classImplementation = $this->haveTheFileImplementationOf($path. $fileOrDir);
                        if ($classImplementation) {
                            return $classImplementation;
                        }
                    }
                }
            } else {
                throw new PluginException('Invalid plugin structure path, check the main config.ini file');
            }
        }

        return null;

    }