Refactor the metrics.