Change the representation of optimized list of operation and add folding.