public static function factory($config = array())
    {
        $default = array(
            'base_url' => 'https://addons.mozilla.org/nl/firefox/addon/',
            'debug' => false
        );
        $required = array('base_url', 'app_name');
        $config = Collection::fromConfig($config, $default, $required);

        $client = new self($config->get('base_url').$config->get('app_name') . '/statistics', $config);
        // Attach a service description to the client
        $description = ServiceDescription::factory(__DIR__ . '/services.json');
        $client->setDescription($description);

		if($config->get('debug')){
			$client->addSubscriber(LogPlugin::getDebugPlugin());	
		}		
        return $client;
    }