Preparing to clean-up flattening and to generate Jacobians automatically