Code cleanup stage 1.