move metricsHandler to func