(Partial) cgutils migration