protected function getTarget($generateInstance = true)
    {
        $serviceLocator = $this->getServicelocator();
        // set the actual options
        $this->getGenerator();
        $target = null;
        if (array_key_exists('target', $this->options)) {
            $target = $this->options['target'];
            if (is_string($target)) {
                if ($serviceLocator->has($target)) {
                    $target = $serviceLocator->get($target);
                    if ($generateInstance) {
                        $target = get_class($target);
                    }
                } else {
                    if ($generateInstance) {
                        $target = new $target;
                    }
                }
            }
        }
        return $target;
    }