refactor metric registy