Refactored barChart