move C generators to helpers