Refactored tip calculator.