clean up code. move chart data into service