Moved report generation into JS