Add format merging and term encapsulation