Code cleanup pass