Majority: ALEXANDER, MEAD, GORMAN, JABAR, and HUMPHREY, JJ.
Concurrence/Dissent: HJELM, J.
ALEXANDER, J.[¶ 1] Dorothy and Wayne Knope appeal from a judgment of the Superior Court (York County, O’Neil, J.), following a non-jury trial. The judgment applied principles of unjust enrichment to determine that the Knopes are liable for certain charges beyond undisputed amounts of principal and interest owed pursuant to a promissory note owned by Green Tree Servicing, LLC. The note had been secured by a mortgage, but an assignment failed to convey to Green Tree all of the rights created by the mortgage.
[¶ 2] The Knopes contend that the contractual relationship between the parties, as established by the note, bars application of rules of unjust enrichment to allow retention of funds that were obligations pursuant to the ineffective mortgage but were *698not obligations pursuant to the note. Because the trial court, in its decision, did not sufficiently distinguish charges that were obligations pursuant to the note from charges that were obligations only pursuant to the mortgage, we vacate the judgment and remand for the court to determine what amount, if any, Green Tree may retain pursuant to the note.
I. CASE HISTORY
[¶-3] The following facts were either alleged in the Knopes’ complaint and deemed admitted because a default was entered against Green Tree, see M.R. Civ. P. 8(d); Ireland v. Carpenter, 2005 ME 98, ¶ 18, 879 A.2d 35, or found by the trial court and supported by the evidence in the record at trial. In November 2004, Dorothy and Wayne Knope executed and delivered a promissory note for $324,940 payable to GMAC Mortgage,Corporation, to purchase a house in Eliot. The house was to be an income-producing property, not a residence for the Knopes. To secure the debt, the Knopes executed a mortgage deed to Mortgage Electronic Registration Systems, Inc. (MERS), as: nominee for GMAC Mortgage Corporation.1 In early 2013, Green Tree purchased various assets and mortgage servicing rights from GMAC, including the Knopes’ loan. MERS purportedly assigned, the mortgage to Green Tree in April 2013, but because MERS had acquired only the right to record the mortgage, the assignment to Green Tree conveyed nothing more than that right. See Bank of America, N.A. v. Greenleaf, 2014 ME 89, ¶¶ 15-16, 96 A.3d 700.
[¶ 4] In January 2013, the pipes in the second floor of the house burst, resulting in severe water damage that rendered the house uninhabitable. Faced with significant costs to repair the house, the Knopes did not make any further mortgage payments except for the escrow portion of, two monthly payments. In May 2014, pursuant to 14 M.R.S. § 6301 (2016), the Knopes sent Green Tree a written demand for an accounting of their liability under the note and mortgage, but, as with earlier attempts at contact by the Knopes, Green Tree did not respond.
[¶ 5] In May 2014, the Knopes filed a complaint against Green Tree, seeking a declaratory judgment as to the amount owed to Green Tree on their note and mortgage, an accounting pursuant to section 6301, equitable relief, and a determination of impracticability of performance because the Knopes had been unable to make payments due to the loss of rental income. Shortly after the Knopes filed this action, Green Tree commenced a separate action for foreclosure.
[¶ 6] Green Tree failed to file a timely answer to the Knopes’ complaint, and on the Knopes’ motion, the clerk entered a default. See M.R. Civ. P, 55(a). After Green Tree moved unsuccessfully to set aside the default, the court ordered that a hearing be held to determine the relief available to the Knopes.
[¶ 7] While this action was pending, but before the hearing was held, the Knopes repaired and then sold the property. Pursuant to an agreement reached by the parties, the foreclosure action was dismissed, and the Knopes paid to Green Tree both the undisputed portion of their debt on the note and, subject to the outcome of this action, additional amounts *699that were in dispute. Specifically, the Knopes paid to Green Tree $338,892.45, which included (1) the amount that the parties agreed was owed for principal and interest on the note, and (2) an additional amount of $19,265.68 charged by Green Tree but contested by the Knopes. The disputed amount represented reimbursements for payments that had been made by Green Tree: $14,701.49 in property taxes and insurance on the property; $945 in property preservation fees; $2,769.19 in “foreclosure fees”; and $850 in. “legal fees.” The parties agreed that they would litigate the question of whether Green Tree was entitled.to retain all or part of that disputed sum.
[¶ 8] The court held a non-jury trial in July 2015, where the Knopes pressed only their claim for a judgment declaring that Green Tree was not entitled to retain the disputed sum. The evidence included a copy of the promissory note, which the Knopes agreed had been owned by Green Tree before it was discharged. The note provided that in the event of a default, the holder of the note would be entitled to recover the costs and expenses of enforcing the note, including reasonable attorney fees. A mortgage deed was also admitted into evidence. The mortgage deed specified that the lender would be entitled to reimbursement for its payment of property taxes; hazard and property insurance; costs to secure and protect the property; and, in the event of nonpayment on the note, attorney fees and costs to foreclose.
[¶ 9] The Knopes argued at trial that the mortgage assignment from MERS to Green Tree was not effective to convey the mortgage-based rights for reimbursement of expenses paid by Green Tree and that Green Tree was therefore not entitled to retain payments for expenses that were allowed only by the mortgage. Because the Knopes had not previously raised a question regarding the effectiveness of the assignment, and .in light of Green Tree’s assertion of surprise, the court granted Green Tree leave to submit additional evidence on the issue and granted the parties leave to file post-trial briefs.
[¶ 10] In September 2015, the court issued a judgment in favor of Green Tree based on a theory of unjust enrichment. The court determined that the mortgage assignment from MERS to .Green Tree was not sufficient to give Green Tree “contractual authority to enforce rights created by the mortgage.” “[T]o avoid unjust enrichment,” the judgment allowed Green Tree to retain the entire disputed amount because Green Tree had paid expenses that were the Knopes’ responsibility under the mortgage to protect Green Tree’s “security interest,” and to keep the property saleable while the Knopes were in default. The Knopes timely appealed.
II. LEGAL ANALYSIS
[¶ 11] The Knopes challenge the court’s application of unjust enrichment to award Green Tree the right to retain the disputed sum. We review both a default judgment and a declaratory judgment for abuse of discretion. See Richter v. Ercolini, 2010 ME 38, ¶ 18, 994 A.2d 404; Linnehan Leasing v. State Tax Assessor, 2006 ME 33, ¶ 30, 898 A.2d 408.
[¶12] To prevail ón a claim for unjust enrichment, the complaining party must show that “(1) it conferred a benefit on the other party; (2) the other party had appreciation or knowledge of the benefit; and (3) the acceptance or retention of the benefit was under such circumstances as to make it inequitable for it to retain the benefit without payment of its value.” Maine Eye Care Assocs., P.A. v. Gorman, 2008 ME 36, ¶ 17, 942 A.2d 707 (citation omitted). In this way, the doctrine of unjust-enrichment allows “recovery for the *700value of the benefit retained when there is no contractual relationship, but when, on the grounds of fairness and justice, the law compels performance of a legal and moral duty to pay.” Paffhausen v. Balano, 1998 ME 47, ¶ 6, 708 A.2d 269.
[¶ 13] The existence of a contractual relationship between the parties that addresses the sums in dispute “precludes recovery on a theory of unjust enrichment.” Nadeau v. Pitman, 1999 ME 104, ¶ 14, 731 A.2d 863; Paffhausen, 1998 ME 47, ¶ 6, 708 A.2d 269. Thus, a limiting principle on the availability of restitution based on unjust enrichment is that “[a] valid contract defines the obligations of the parties as to matters within its scope, displacing to that extent any inquiry into unjust enrichment.” Restatement (Third) of Restitution & Unjust Enrichment § 2(2) (Am. Law Inst. 2011) (emphasis added). The rationale behind this rule is that courts should not intervene to redefine rights and obligations that parties have already defined for themselves through a voluntary contract. See Wal-Noon Corp. v. Hill, 45 Cal.App.3d 605, 119 Cal.Rptr. 646, 651 (1975) (“[W]here the parties have freely, fairly and voluntarily bargained for certain benefits in exchange for undertaking certain obligations, it would be inequitable to imply a different liability and to withdraw from one party benefits for which he has bargained and to which he is entitled”).
[¶ 14] Because of the “failed” mortgage, the only contract between the parties is the promissory note, and most of the expenses at issue here were not paid or recoverable pursuant to that note. Nothing in the promissory note indicates that the Knopes bargained for or were entitled to most of the benefits they received—the payment, by Green Tree, of their property taxes, insurance, and property preservation costs.2 Thus, Green Tree’s retention of payment for those expenses on an unjust enrichment theory is not barred by the law as articulated in the Restatement. There is no apparent rationale for expanding the Restatement’s limiting principle to apply to parties who simply have some contractual relationship with one another, where their contract does not address the basis for the unjust enrichment claim.
[¶ 15] The United States District Court addressed issues similar to the limiting principle in the Restatement in Federal Insurance Company v. Maine Yankee Atomic Power Company, 183 F.Supp.2d 76, 85 (D. Me. 2001), discussing whether contracting parties “intended to occupy the universe of their financial relationships by the terms and provisions of’ their contract. Maine Yankee, which applied our opinion in Nadeau v. Pitman, does not bar recovery based on unjust enrichment. Maine Yankee expressly cautions that “parties may have any number of ... contractual relationships having nothing to do with the issue in question and the Law Court cannot have intended to foreclose all unjust enrichment claims between such parties.” Me. Yankee, 183 F.Supp.2d at 84.
[¶ 16] The Maine Yankee opinion looked to the terms of the parties’ existing contract to determine whether the contract *701addressed the obligation at issue in the unjust enrichment claim, concluding that it did not because the contract “simply [did] not speak to the benefit that would be conferred upon” Federal Insurance when Maine Yankee made payments on behalf of the third party for which Federal Insurance was secondarily responsible. Id. at 85-86. Because the claim concerned obligations that the parties’ contract did not address, the unjust enrichment claim was cognizable as long as it satisfied the substantive elements of the unjust enrichment doctrine. Id.
[¶ 17] The court thus clarified that the relevant question is whether the basis for the putative unjust enrichment claim concerns the same rights and obligations that the parties had already defined voluntarily by contract. Id. The court concluded that Maine Yankee could proceed in its unjust enrichment claim because (1) Federal Insurance had an existing, legally enforceable obligation to make certain payments if a third party failed to do so; (2) Maine Yankee “stepped in—not as a volunteer— and paid, the result being that Federal Insurance did not have to”; and (3) the contract between the Federal Insurance and Maine Yankee did not address the benefit that Maine Yankee conferred on Federal Insurance when Maine Yankee made the payments. Id. at 85-86.
[¶ 18] The court’s reasoning is sound, and the same situation exists in this case: (1) the Knopes had a-legally enforceable obligation to pay the taxes and insurance on their property and to keep the property in good repair; (2) presumably under the mistaken belief that it had the right to do so to protect a security interest that it thought it had acquired and to be reimbursed for doing so, Green Tree stepped in—“not as a volunteer”—and paid the Knopes’ taxes, insurance, and property preservation costs,3 the result being that the Knopes did not have to; and (3) no contract between the Knopes and Green Tree addressed the parties’ rights and responsibilities with respect to taxes, insurance, or preservation costs, which was the subject matter of the unjust enrichment award.
[¶ 19] Holding the Knopes liable for restitution to avoid unjust enrichment does not represent “an impermissible end run around a voluntary structuring of relationships and their consequences,” Me. Yankee, 183 F.Supp.2d at 85, because the parties’ only contractual agreement (the note) contains no voluntary structuring of rights and obligations regarding the payment of taxes, insurance, or preservation costs. As in Maine Yankee, the parties’ contract here, the note, “simply does not speak to the benefit that would be conferred upon” the Knopes by Green Tree’s payment of taxes, insurance, or preservation costs. Id.
[¶ 20] The Knopes argue that the promissory note, originally executed between *702the Knopes and GMAC Mortgage Corporation, combined with the mortgage to create an integrated contractual relationship between Green Tree and the Knopes that precludes Green Tree from proceeding on an unjust enrichment claim to retain expenditures that are not recoverable under the note. However, the promissory note is separate from the mortgage, and the promissory note’s obligations are separate from the claims related to enforcement of the mortgage. Green Tree may have acted in the mistaken belief that it was a mortgagee, but that belief does not import the terms of the mortgage into the parties’ only actual contract, the promissory note. The mortgage, unlike the note, did not occupy any part of the universe of the parties’ financial relationships.
[¶ 21] Were the note and the mortgage contract treated, under the law, as one unit, or as related transactions involving the same parties, then actions on the note would always have to be joined and adjudicated with actions on the mortgage. Parties could not achieve a dismissal of claims asserted under an insufficiently assigned mortgage, because the claims asserted under the note would have to be considered in a unitary proceeding, barring final judgment until liability under the note had been adjudicated.4
[¶22] Actions under the mortgage may be treated as separate and distinct from actions under the note because notes are unsecured and separate from mortgages, presenting differing issues that may, sometimes, be adjudicated in separate proceedings. See Greenleaf, 2014 ME 89, ¶¶ 14-17, 96 A.3d 700; Mortgage Elec. Registration Sys. v. Saunders, 2010 ME 79, ¶ 10, 2 A.3d 289.
[¶ 23] With regard to at least the $14,701.49 paid for property taxes and insurance, and the $946 in property preservation fees, the evidence establishes, and the trial court found, that each of the elements of Green Tree’s unjust enrichment claim has been met: (1) the benefits were conferred on the Knopes; (2) the Knopes had appreciation or knowledge of these benefits; and (3) acceptance or retention of the benefits by the Knopes, after payment of those benefits enabled them to sell the property without other encumbrances, was under such circumstances as to make it inequitable for the Knopes to retain the value of those benefits. See Gorman, 2008 ME 36, ¶ 17, 942 A.2d 707.
[¶ 24] Because, by agreement, the mortgage is invalid and inapplicable as between Green Tree and the Knopes, and the benefits Green Tree conferred were not paid in accordance with and are not recoverable under any other contract, the trial court properly determined that these benefits were recoverable by Green Tree to avoid unjust enrichment. Accordingly, we affirm that portion of the trial court’s judgment that authorized Green Tree to recover, or retain, the benefits paid for taxes, insurance, and property preservation costs, a total of $16,646.49. We must vacate and remand only for reexamination of the sup*703port for recovery of the foreclosure fees and legal fees based on an unjust enrichment theory and to determine what sums, if any, are due under the promissory note.5
The entry is:
Judgment affirmed in part and vacated in part. Remanded to the Superior Court for further proceedings in accordance with this opinion.
." Although not expressly recited by the court, the mortgage, which ■ was admitted in evidence at, trial without objection, identified GMAC as the lender, and Mortgage Electronic Registration Systems, Inc., as both nominee for GMAC and mortgagee of record "FOR PURPOSES OF RECORDING THIS MORTGAGE."
. The payment of these benefits by Green Tree, and the acceptance of these benefit payments by the Knopes, facilitating the sale of their home in reasonable repair and without encumbrances, precludes the argument suggested in the dissent, referencing Mortgage Electronic Registration Systems, Inc. v. Saunders, 2010 ME 79, ¶ 9, 2 A.3d 289, that because Green Tree was presumptively on notice as to the insufficiency of the MERS assignment, Green Tree cannot recover the benefits accepted by the Knopes that facilitated sale of their home and payment of the note. See Concurrin^Dissenting Opinion ¶¶ 41-42.
. Recovery in unjust enrichment is denied to a "volunteer” in order "to penalize those who ‘thrust benefits upon others.' " Federal Insurance Co. v. Maine Yankee Atomic Power Co., 183 F.Supp.2d 76, 83 n.10 (D. Me. 2001) (quoting Restatement of Restitution § 2 cmt. a (Am. Law. Inst. 1937)). Here, Green Tree was not a volunteer—its expectation of repayment was reasonable and the Knopes could not reasonably have expected that they would not have to pay for the taxes, insurance, and preservation fees on their property. In other words, “the circumstances of the transaction justif[ied Green Tree’s] intervention in the absence of contract.” Restatement (Third) of Restitution & Unjust Enrichment § 2(3) (Am. Law Inst. 2011). This case presents a common situation in which a party receiving a benefit not contemplated by a contract between the parties may be liable for restitution in order to avoid unjust enrichment. See id. § 7 (“Mistaken performance of another’s obligation gives the performing party a claim in restitution against the obligor to the extent of the benefit mistakenly conferred on the obli-gor.”); id. cmt. a.
. Related claims between the same parties and involving the same transaction must be joined in the same action. See Beegan v. Schmidt, 451 A.2d 642, 645 (Me. 1982) (observing that when there is a final judgment against the plaintiff, claims the plaintiff has against the same defendant are extinguished with regard to all or any part of the transaction, or series of connected transactions, out of which the action arose), “The doctrine of res judicata prevents relitigation if: (1) the same parties or their privies are involved in both actions; (2) a valid final judgment was entered in- the prior action; and (3) the matters presented for decision in the second action were, or might have been litigated in the first action.” St. John v. Jordan, 2008 ME 68, ¶ 5, 945 A.2d 1232 (quoting Portland Water Dist. v. Town of Standish, 2008 ME 23, ¶ 8, 940 A.2d 1097).
. The Concurring/Dissenting Opinion, at ¶ 38, indicates that unjust enrichment cannot support the claim for attorney fees and foreclosure expenses. This opinion does not suggest otherwise.