update barchart & search option, start cleaning up global scope