Cleaning up C code