Substitute instance variable used once with method

Or in technical terms: "Replace Temp with Query".