private function getTheme($target, $themeId){

        $returnValue = null;
        if(!$this->isRegistered($target)){
            throw new \common_Exception('Target '.$target.' does not exist');
        } else {
            $array = $this->get($target);
            $found = false;
            foreach ($array['available'] as $theme) {
                if ($theme['id'] == $themeId) {
                    $found = true;
                    $returnValue = $theme;
                    break;
                }
            }
            if (!$found) {
                throw new ThemeNotFoundException('Theme '.$themeId.' not found for target '.$target);
            }
        }
        return $returnValue;
    }