Barchart plugin code cleanup