Refactoring the payment class method