General code cleaning