clean up mgof code