refactor unionpay