use CompositePatch for FlattenInteraction
refactoring of FlattenInteraction