Cleaner way of creating highcharts graphs