Refactor tip calculator to incorporate method