remove duplication in xpool.rb