tidy up generated C code