Refactor metrics reporting