Preparing QC and HTML output