simplifying logic for payment generation