Move common functionality into Metric trait. Minor refactoring.