Cleaning up the drawing code.