Fix metrics reporting

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