Added additional metrics. More refactoring.