Temporary variables create additional locally scoped names and complicate extraction. Before: def calculateTotal(): basePrice = quantity * itemPrice if basePrice > 1000: return basePrice * 0.95 else: return basePrice * 0.98 After: def calculateTotal(): if basePrice() > 1000: return basePrice() * 0.95 else: return basePrice() * 0.98 def basePrice(): return quantity * itemPrice References refactoring.guru 📚 Refactoring - Improving the Design of Existing Code, Martin Fowler