Minimum changes in CG optimizer