More code cleanup and chart tweaks