Refactors code out of controller into tips_calculator class