pool query spike, refactoring