Fix metrics reporting

Also reduced nesting and indentation to help with the readability and changes some names and comments for consistency.