pool refactor