Cleanup chart js code