protected function recomposePattern(array $terms, array $supportedTerms, $domain = NULL)
    {
        $recomposed = '';
        
        if ($domain !== NULL)
        {
            $recomposed .= '@'.$domain.' ';
        }
        
        foreach ($supportedTerms as $term) {
            if (array_key_exists($term, $terms) && $term !== '_default') {
                $recomposed .= ' '.$term.':';
                $recomposed .= (mb_stristr(' ', $terms[$term]) === FALSE) ?  $terms[$term] : '('.$terms[$term].')';
            }
        }
        
        if ($terms['_default'] !== '') {
            $recomposed .= ' '.$terms['_default'];
        }
        
        //strip first character if empty
        if (mb_strcut($recomposed, 0, 1) === ' '){
            $recomposed = mb_strcut($recomposed, 1);
        }
        
        return $recomposed;
    }