more cleaning up in the plotting code