refactor pool functions