refactor: extract method getMetricsMethod