refactor the report_* func and calls to be more generic
some minor optimizations/clarity