Step 6 - extract method - getTotalAmount()