Refactoring in ChartDataProvider.