我希望把这段投诉代码函数内的逻辑处理稍微整理下，让其更紧密一些。```
// 确认支付完成
def confirmPayment {
    paymentStatus = getPaymentStatus()
    if (paymentStatus == "COMPLETED") {
        notifyUser("Payment completed successfully.")
    } else {
        notifyUser("Payment not completed yet.")
    }
// 检查是否有未支付订单
def checkUnpaidOrders {
    unpaidOrders = getUnpaidOrders()
    if (unpaidOrders.length > 0) {
        notifyUser("You have unpaid orders.")
    } else {
        notifyUser("No unpaid orders.")
    }
}```
user
```
// 确认支付完成并通知用户
def confirmPayment {
    paymentStatus = getPaymentStatus()
    message = (paymentStatus == "COMPLETED") ? "Payment completed successfully." : "Payment not completed yet."
    notifyUser(message)
}

// 检查并通知用户是否有未支付订单
def checkUnpaidOrders {
    unpaidOrders = getUnpaidOrders()
    message = (unpaidOrders.length > 0) ? "You have unpaid orders." : "No unpaid orders."
    notifyUser(message)
}
```
assistant