refactored the code to have smaller methods and remove unused code(5 months' bar charts)