Cleaning up / refactoring Bar Chart code