refactor metrics test