Remove redundant code to remove contained tags.
fixup
Create a type for each group in a pattern.