Refactoring with Method: Replace Temp with Query