refactoring CG