refactor pool checking