public function createInstance($className, array $args = null)
    {

        $args = $args ? $args : [];
        $className = $this->resolveClassName($className);

        if (!class_exists($className) || ($this->_baseClassName && !is_subclass_of($className, $this->_baseClassName)))
            throw new FactoryException(
                "Failed to resolve factory classname: "
                ."$className does not exist or is not a valid {$this->_baseClassName}"
            );

        $ref = new \ReflectionClass($className);

        return $ref->newInstanceArgs($args);
    }