Some general code cleaning