DRY, clean the C code up a bit