why not store `$payment = $order->getPayment();` ? since you use it so many times?