code cleanup for canvas and gfx