Simplify the canvas code some