Cleanup plot2 code