code cleanup p2