improved the code of IntelliPool