refactoring pool size monitoring