Clean up map drawing code.