minimize some code in payment controller