このコードをリファクタリングするにはどうすればよいのでしょうか?
def next_payment_price
price = self.plan_price
price = discounted_price if self.coupon && self.coupon_duration.nil? && self.coupon_discount != 100
price = discounted_price if self.coupon && self.coupon_duration.present? && self.coupon_discount != 100 && ((self.created_at + 14.days + self.coupon_duration.month) > Time.now )
price
end
def discounted_price
self.plan_price - ((self.plan_price * self.coupon_discount) / 100)
end