Refactor report writing to use ReportMetrics and extract ReportWriter interface