public function resolve($class, $name = null)
    {
        $class = ltrim($class, '/');

        if (null === $name) {
            $name = $class;
        }

        if (false === $this->has($name)) {
            $this->set($name, $class, null);
        }

        return $this->getFactory($name)->get();
    }