Refactor MetricFu::Templates::MetricsTemplate#write into a composed method.