code cleanup stage 3.