refactoring

Replace Temp with Query