new flattener optimizer