Refactoring with Method: Extract Method
Refactoring with Method: Replace Temp with Query

replacing totalAmount with a charge method