code cleanup for plot area