Refactoring lineChartData to introduce controllers