Improve route-drawing code.