outsourced qualityMetricsCounter from main.js to qualityMetricsCounter.js