finished refactoring metrics partitioning