refactor/seperate cg