Clean up drawing code