metric refactor