merging flattenTerms with FlatenSyntax in variables