Modernize cgen