public function getFactory($name)
    {
        if (!isset($this->factories[$name])) {
            throw new \RuntimeException(sprintf('No factory registered with name "%s"', $name));
        }

        return $this->factories[$name];
    }