moved lib/metrics_hash into models.