refactoring pool and metrics