refactor metric tests