refactor after change code in ResourcePool