Cleanup drawing code