
    Jeanette MARTINEZ, Petitioner, v. CONTINENTAL ENTERPRISES, and Roy Myrick, d/b/a Continental Enterprises, Respondents.
    No. 84SC457.
    Supreme Court of Colorado, En Banc.
    Dec. 15, 1986.
    
      Stitt, Wittenbrink and Nieman, P.C., R.J. Wittenbrink, Daniel F. Collopy, Westminster, for petitioner.
    J.D. Pearson, Denver, for respondents.
   KIRSHBAUM, Justice.

In Martinez v. Continental Enterprises, 697 P.2d 789 (Colo.App.1984), the Court of Appeals reversed the trial court’s judgment granting the respondents, Continental Enterprises and Roy Myrick, d/b/a Continental Enterprises, a decree of foreclosure under a deed of trust on property owned by the petitioner, Jeanette Martinez. The Court of Appeals concluded that Myrick’s foreclosure action was barred by a statute of limitation, but that he nevertheless was entitled to recover sums due on the promissory note underlying the deed of trust, subject to an accounting between the parties, under the doctrine of mortgagee in possession. The Court of Appeals also affirmed the trial court’s award of attorney fees to Myrick. Having granted certiorari to review these determinations, we affirm in part, reverse in part, and remand the case to the trial court for further proceedings.

I

On July 9, 1967, Martinez and three of her relatives purchased a house on Sheridan Boulevard from the respondents. In connection with this transaction, the buyers paid a small down payment and executed a promissory note in favor of the respondents for the balance of the purchase price. As additional security for the note, Martinez executed a third deed of trust upon her home on Meade Street.

In February 1968, the payors defaulted on the note. However, Martinez’ relatives did not vacate the Sheridan Boulevard house until early 1971, when they rescinded the contract. The respondents took possession of the property, which was later resold. After the net proceeds of the sale were credited against the indebtedness due on the promissory note, a deficiency remained. The respondents neither released the third deed of trust on Martinez’ Meade Street property nor made demand on Martinez or her relatives to satisfy the deficiency-

In late 1971 or early 1972, Martinez vacated her Meade Street house because she was not able to bear the cost of repairing a faulty furnace. Shortly thereafter Martinez’ mother gave Myrick the keys to that house, and Myrick assumed control of the property until October 1978. During those six years, Myrick made the monthly payments due on the notes secured by the two prior deeds of trust on the property and also paid certain utility bills. Myrick used the property primarily for storage purposes, although he intermittently permitted people to reside in the house.

In 1978, Martinez filed a quiet title action against the respondents to gain possession of the Meade Street property. A default judgment was entered, and in October 1978 Martinez evicted Myrick and regained occupancy. The default judgment was later vacated; however, Martinez continued to occupy the premises.

Martinez subsequently amended her original complaint to add claims of wrongful possession and unjust enrichment due to loss of rental income during Myrick’s possession. The respondents answered and filed a counterclaim for the balance due on the 1967 promissory note and for foreclosure of the third deed of trust on the Meade Street property.

After a bench trial, the trial court concluded that although the respondents’ promissory note claim was barred by section 13-80-110, 6 C.R.S. (1973), a six-year statute of limitation, their claim for foreclosure of the deed of trust was timely under section 38-40-105, 16A C.R.S. (1982), a fifteen-year statute of limitation. The trial court also concluded that the respondents were entitled to recover their attorney fees in connection with the foreclosure action.

The trial court dismissed Martinez’ claims, but concluded that she was entitled to an offset against the sum recoverable by the respondents in an amount equal to the reasonable rental value of the Meade Street property from July 1, 1972, until October of 1978. This conclusion was based on the determination that the deed of trust granted the respondents the right to take possession of the Meade Street property upon default on the underlying note, but that they should have instituted their foreclosure proceedings within a reasonable time after taking possession of the property, which reasonable time expired on July 1, 1972. The trial court also ruled that the respondents should be credited for the sums Myrick paid on the notes secured by the first and second deeds of trust and for certain of the utility bills he paid.

Both Martinez and the respondents appealed portions of the trial court’s judgment. The Court of Appeals reversed the trial court’s foreclosure order and remanded the case with directions to conduct a new accounting. The Court of Appeals held that the respondents’ claim under their third deed of trust was barred by section 38-40-112, 16A C.R.S. (1982), which provides that a lien is extinguished when the right to recover on the underlying debt is barred by a statute of limitation. The Court of Appeals also held that under the doctrine of mortgagee in possession Martinez’ right of possession was contingent upon her satisfaction of the debt underlying the deed of trust. The Court of Appeals apparently affirmed the trial court’s award of attorney fees.

II

The respondents contend that, as mortgagees, they have a fifteen-year period in which to foreclose a deed of trust following default on the underlying promissory note, regardless of whether an action may be maintained on the note itself. We disagree.

The period of limitation established by the General Assembly for any action on a promissory note in default is six years from the date of default. § 13-80-110, 6 C.R.S. (1973) (repealed and reenacted 1986) (current version at § 13-80-103.5, 6 C.R.S. (1986 Supp.)). Although Martinez and her relatives defaulted on the promissory note in 1968, no action was filed on the note until 1979. Martinez having properly raised the statute of limitation as an affirmative defense, see C.R.C.P. 8(c), the respondents’ action on the note is barred.

The respondents urge that even if the claim on the note is barred, this case is best resolved by application of the doctrine that the bar of an action for debt does not bar other remedies for the same obligation. This argument fails to take into account section 38-40-112, 16A C.R.S. (1982), which states as follows:

The lien created by any instrument shall be extinguished, regardless of any other provision in this article to the contrary, at the same time that the right to commence a suit to enforce payment of the indebtedness secured by the lien is barred by any statute of limitation of this state.

Under this statute, when an action to recover on a promissory note is barred, any lien securing such note is extinguished. At the time the respondents filed their foreclosure claim, the lien on the Meade Street property was already extinguished. Section 38-40-112 precludes the respondents from foreclosing on property upon which they hold no encumbrance. See generally 3 R. Powell, The Law of Real Property 11461 (1986) (foreclosure action cannot be maintained where statutory provisions extinguish the lien); see, e.g., Cal.Civ.Code § 2911 (West 1974); Mont.Code Ann. § 71-3-122 (1985).

The respondents argue that their foreclosure action was not barred by section 38-40-112 because section 38-40-105, 16A C.R.S. (1982), which establishes a fifteen-year period within which to foreclose a deed of trust after default on the underlying note, is applicable. As we have indicated, section 38-40-112 provides that any lien created by default on a promissory note is extinguished when an action to recover on the underlying note is barred. Any action to recover on the 1967 note was barred by the terms of section 13-80-110 when the respondents filed their foreclosure claim.

The legislative purpose in providing a longer time period within which to bring a foreclosure action in some cases is suggested by the fact that section 38-40-105 is included within a marketable title act. Section 38-40-105 originally appeared within an act entitled: “An act concerning real property and to render titles to real property and to interests and estates therein, more safe, secure and marketable.” Act of Mar. 28, 1927, ch. 150, 1927 Colo.Sess.Laws 585. Although the title of a statute is not dispositive of legislative intent, it may be used as an aid in construing a statute. U.M. v. District Court, 631 P.2d 165 (Colo.1981); Conrad v. City of Thornton, 191 Colo. 444, 553 P.2d 822 (1976).

Section 44 of the 1927 statute articulated that the act’s purpose was to render titles more secure and marketable and, to further that purpose, stated that the act should be construed to enable purchasers to rely on record titles. Act of Mar. 28, 1927, ch. 150, § 44, 1927 Colo. Sess. Laws 585, 605. The statute is thus a curative measure, designed to promote certainty in transactions involving titles of record. The limitation period for foreclosure furthers the goal of simplifying land title transactions by freeing titles from the cloud of potential encumbrances after a specified period of time. See Morris, Curative Statutes of Colorado Respecting Titles to Real Estate, 26 Dicta 281 (1949). Under this statutory scheme, a lien is extinguished in six years if recovery on the underlying note is barred by the six-year statute of limitation. However, if the six-year statute is for some reason tolled, such as where the plaintiff lacks capacity to sue or where the defendant is absent from the state, the ultimate marketability of title is assured by placing an outer limit of fifteen years on the time period during which the lien is deemed viable. F. Storke & D. Sears, Colorado Security Law § 83 (1955). Where, as here, any action to recover payment on a promissory note is barred by the six-year statute of limitation, foreclosure on the deed of trust securing the note is also barred. Birkby v. Wilson, 92 Colo. 281, 19 P.2d 490 (1933).

Ill

The respondents next urge that under the doctrine of mortgagee in possession they had the right to obtain possession of the Meade Street property and to retain that possession until the promissory note secured by the property was paid. This court has not heretofore adopted the doctrine of mortgagee in possession. Whatever its efficacy might be in other contexts, we conclude that the doctrine is inapplicable to the circumstances of this case.

Under the common law doctrine of mortgagee in possession a mortgagee may acquire possession of property securing an indebtedness upon default of the mortgagor and retain possession of the premises until the mortgagor redeems the property or until the property is foreclosed. See generally G. Nelson & D. Whitman, Real Estate Finance Law § 4.24 (2d ed. 1985). Colorado, however, has by statute adopted a lien theory of mortgages, which theory generally prohibits a mortgagee from acquiring possession of mortgaged property until a foreclosure and sale have occurred. Section 38-35-117, 16A C.R.S. (1982), states as follows:

Mortgages, not a conveyance — lien theory. Mortgages, trust deeds, or other instruments intended to secure the payment of an obligation affecting title to or an interest in real property shall not be deemed a conveyance, regardless of its terms, so as to enable the owner of the obligation secured to recover possession of real property without foreclosure and sale, but the same shall be deemed a lien.

Section 38-39-112, 16A C.R.S. (1982), contains the following limited exception to section 38-35-117:

Receiver appointed upon application. (1) When an action or proceeding has been commenced to foreclose a mortgage, trust deed, or other instrument securing an indebtedness, a receiver of the property affected shall be appointed upon application at any time prior to the sale, if it appears that the security is clearly inadequate or that the premises are in danger of being materially injured or reduced in value as security by removal, destruction, deterioration, accumulation of prior liens, or otherwise so as to render the security inadequate.
(2) If the facts would justify the appointment of a receiver under this section but one is not applied for and if the premises are abandoned by the owner thereof, the holder of the lien may take possession until the sale and shall be subject to the same duties and liabilities for the care of the premises and for the application of the rents and profits as would a receiver.

The Court of Appeals concluded that Martinez had abandoned the Meade Street property and, pursuant to section 38-39-112, that the respondents were entitled to retain possession of the property until Martinez satisfied the underlying debt. We disagree.

Section 38-39-112(2) requires abandonment of the property by the mortgagor as a precondition to possession by the mortgagee. The trial court specifically found that the property had not been abandoned. Factual findings of a trial court may not be disturbed on appeal where, as here, they are supported by the record. Travelers Insurance Co. v. Wellman, 721 P.2d 685 (Colo.1986); Johnson v. Smith, 675 P.2d 307 (Colo.1984); Gebhardt v. Gebhardt, 198 Colo. 28, 595 P.2d 1048 (1979). The Court of Appeals’ ruling that Martinez had abandoned the Meade Street property is erroneous.

Moreover, under section 38-39-112(2), a mortgagee may take possession of the mortgaged property only after a foreclosure proceeding has been commenced. Section 38-39-112(1) provides for appointment of a receiver “[w]hen an action or proceeding has been commenced to foreclose a mortgage, trust deed, or other instrument securing an indebtedness.” Subsection (2) allows a mortgagee to take possession “until the sale” under the same standards as applicable to appointment of a receiver under subsection (1). A statute is to be construed as a whole to give a consistent, harmonious and sensible effect to all its parts. Colorado Department of Social Services v. Board of County Commissioners, 697 P.2d 1 (Colo.1985); Watson v. People, 700 P.2d 544 (Colo.1985); Massey v. District Court, 180 Colo. 359, 506 P.2d 128 (1973). A statute must also be construed to further the legislative intent evidenced by the entire statutory scheme. Public Employees Retirement Association v. Greene, 195 Colo. 575, 580 P.2d 385 (1978); Allen v. Charnes, 674 P.2d 378 (Colo.1984). Applying these principles, we conclude that section 38-39-112 reflects a strong legislative intent to protect a homeowner’s right to possess and enjoy his or her home. It requires a mortgagee to commence foreclosure proceedings before taking possession of mortgaged property. A contrary interpretation would mean that a mortgagee could retain possession indefinitely by postponing the commencement of foreclosure proceedings, thus completely frustrating the purpose of section 38-35-117. Because the respondents waited some.seven years after taking possession of the Meade Street property to institute foreclosure proceedings, we conclude that they cannot avail themselves of the exception created by section 38-39-112 to the rule that a mortgagee may not acquire possession of mortgaged property without first instituting a foreclosure action.

IV

A

The trial court held that under the express terms of the deed of trust the respondents had the right to take possession of the Meade Street property in 1972, but that the respondents breached the deed of trust by failing to bring a foreclosure action within a reasonable time after taking possession. However, section 38-35-117 provides that, regardless of the terms of a mortgage or deed of trust, a mortgagee generally may not recover possession of mortgaged property in the absence of foreclosure and sale proceedings. As we previously noted, the limited exception to section 38-35-117 found in section 38-39-112 also contemplates possession only after commencement of a foreclosure proceeding.

To the extent the clause in the deed of trust giving the mortgagee the right to possession on default is inconsistent with the letter and policy of the statutes dealing with the right to possession, the latter must prevail. See Erwin v. West, 105 Colo. 71, 99 P.2d 201 (1939). It is true that in the absence of countervailing public policy or an express statutory provision barring waiver, parties may enter into contracts abrogating or limiting statutory provisions which confer a right or benefit upon one or both parties. Francam Building Corp. v. Fail, 646 P.2d 345 (Colo.1982). Here, the public policy favoring possession by the mortgagor prior to foreclosure is buttressed by section 38-35-117, which establishes lien status for security instruments affecting a title to or an interest in real property “regardless of [the mortgage or deed of trust] terms.” In these circumstances, the statutory provisions must prevail over any contrary contractual provisions. See Erwin v. West, 105 Colo. 71, 99 P.2d 201.

B

The deed of trust also contains a clause purporting to grant the respondents the right to obtain the rents from the mortgaged property in the event of a default “whereby the right of foreclosure occurs.” Without specifically referring to this clause, the trial court ruled that the respondents were not entitled to the rents from the Meade Street property, apparently on the presumption that entitlement to rents is an incident to entitlement to possession.

The deed of trust does not provide that rents obtained by the mortgagee shall reduce the mortgagor’s debt. In Erwin v. West, 105 Colo. 71, 99 P.2d 201, this court concluded that in such circumstances the mortgagee does not automatically acquire a right to rents upon default. The statutory provisions governing the rights of a mortgagee in possession of property support the conclusion that the language of the deed of trust does not grant the mortgagee the right to rents.

Section 38-39-112, 16A C.R.S. (1982), provides that a mortgagee may collect rents incident to rightful possession of the property or may apply for appointment of a receiver to collect and impound the rents. Fisher v. Norman Apartments, Inc., 101 Colo. 173, 72 P.2d 1092 (1937). However, until the mortgagee takes some effectual step to subject the rents to the payment of the debt, such as by gaining rightful possession of the property or by filing a foreclosure action, the mortgagee has but an inchoate right to the rents. Megginson v. Hall, 111 Colo. 104, 137 P.2d 411 (1943); In re Colter, Inc., 46 B.R. 510 (D.Colo.1984). The inchoate right granted by the deed of trust never became a vested right because the respondents did not initiate a foreclosure action prior to taking possession of the mortgaged property. Therefore, the respondents are not entitled to the rents from the mortgaged property during their period of possession.

V

In determining the amounts to be credited to the parties for purposes of a final judgment, the trial court made the following determinations: (1) Martinez was entitled to credit for an amount equal to the reasonable rental value of the Meade Street property from July 1, 1972, until Myrick was evicted in 1978, plus interest thereon; and (2) the respondents were entitled to credit for payments on the notes secured by the two senior deeds of trust on the Meade Street property and for payments of those utility bills which would have constituted a perpetual lien on that property, plus interest thereon. We find application of the principle of unjust enrichment to be appropriate in the circumstances of this case, and conclude that Martinez is entitled to credit for the reasonable rental value of the property as of the date Myrick took possession thereof.

A

To establish a right to recover sums on the basis of unjust enrichment, a plaintiff must establish: (1) that a benefit was conferred upon an adverse party; (2) that the benefit was appreciated by the adverse party; and (3) that the benefit was accepted by the adverse party under such circumstances that it would be inequitable for it to be retained without payment of its value. Cablevision of Breckenridge v. Tannhauser Condominium Association, 649 P.2d 1093 (Colo.1982); Dass v. Epplen, 162 Colo. 60, 424 P.2d 779 (1967). Here, the respondents were in possession of the Meade Street property for approximately six years. The trial court determined that the respondents obtained and appreciated a benefit from possession of the property by using it for storage space and intermittently allowing certain persons to occupy the house. These factual findings are sup-torted by the record and will not be disturbed on appeal. Travelers Insurance Co. v. Wellman, 721 P.2d 685; Johnson v. Smith, 675 P.2d 307; Gebhardt v. Gebhardt, 198 Colo. 28, 595 P.2d 1048.

Although the deed of trust granted the respondents an inchoate right to rents, we have concluded that this right never vested. The parties did not agree that the respondents should possess the Meade Street property or pay for the benefit conferred, and we have concluded that the respondents had no contractual or statutory right to possession of the property. Because the respondents had no right to possess the Meade Street property or obtain rents therefrom, they may not retain the benefits they realized from their possession. Accord Howard v. Edgren, 62 Wash.2d 884, 385 P.2d 41 (1963).

When a court appropriately applies the doctrine of unjust enrichment, the unjustly enriched party is generally liable for interest on the benefits received. D. Dobbs, The Law of Remedies § 3.5 (1973). Failure to award such interest would result in incomplete restitution to the petitioner. We conclude, therefore, that Martinez is entitled to a credit for the reasonable rental value of the property for the entire period of the respondents’ possession thereof, plus interest, computed as provided by section 5-12-101, 2 C.R.S. (1973).

B

During their possession of the Meade Street property, the respondents made payments on notes secured by two deeds of trust senior to their own and on utility bills. The trial court reasoned that those payments avoided defaults under the senior deeds of trust and inured to the benefit of Martinez by reducing the balances due on those debts. The trial court also concluded that payments of utility bills by the respondents did not unjustly enrich Martinez, but rather benefitted the respondents in their use of the property, except for payment of those municipal utility bills which, if unpaid, would constitute a perpetual lien against the property. See § 32-2-119, 13 C.R.S. (1973) (repealed 1981) (current version, enacted in 1981, at § 32—1—1001(1)(j), 13 C.R.S. (1986 Supp.)).

Restitution, or restoration of a party to a prior status, is available as a remedy where reimbursement is due the party for a benefit conferred upon another. See Restatement of Restitution § 1 (1937). The courts have, however, limited the availability of the remedy to those cases where an individual acting out of self-interest confers a benefit upon another. See generally Dawson, The Self-Serving Intermeddler, 87 Harv.L.Rev. 1409 (1974). One of the most compelling cases for relief is presented where a person, in order to protect his or her own interest, pays a lien on the property of another. See, e.g., In re Forester, 529 F.2d 310 (9th Cir.1976); Rock River Lumber Corp. v. Universal Mortgage Corporation of Wisconsin, 82 Wis.2d 235, 262 N.W.2d 114 (1978); see generally 2 G. Palmer, The Law of Restitution § 10.5 (1978).

Here, the respondents made monthly payments toward senior liens on the Meade Street property, as well as payments of utility bills which, if unpaid, would constitute a perpetual lien on the property. It is undisputed that the respondents made the payments out of a desire to protect their interest in the property. It is also undisputed that, because of the respondents’ payments, Martinez was relieved of the necessity of paying to protect her interest in her own property. The record establishes that Martinez was aware that the payments were being made on her behalf. From these circumstances, it must be inferred that Martinez accepted these benefits. We conclude that, to avoid unjust enrichment of Martinez, the respondents are entitled to reimbursement of the value of payments made toward senior liens and toward municipal utility bills which, if unpaid, would constitute a lien upon the property. The respondents are also entitled to statutory interest on those payments, pursuant to section 5-12-101, 2 C.R.S. (1973).

C

The trial court concluded that Martinez also owes the respondents the value of certain payments undisputedly made by the respondents subsequent to 1979 pursuant to stipulation of the parties. Although the parties did not expressly indicate the rate of interest to be applied, the trial court determined that the parties impliedly intended the stipulated payments to carry the same interest rate as the promissory note and deed of trust.

Parties to a contract are free to set the rate of interest by mutual agreement. See, e.g., F.D. McKendall Lumber Co. v. Kalian, 425 A.2d 515 (R.I.1981); First National Bank in Albuquerque v. Abraham, 97 N.M. 288, 639 P.2d 575 (1982). Contracts are to be interpreted to further the intent of the parties thereto. Pepcol Manufacturing Co. v. Denver Union Corp., 687 P.2d 1310 (Colo.1984); Griffin v. United Bank of Denver, 198 Colo. 239, 599 P.2d 866 (1979). Intent may be ascertained by reference to separate ancillary instruments. BA Mortgage Co. v. Unisal Development, Inc., 469 F.Supp. 1258 (D.Colo.1979); Town of Estes Park v. Northern Colorado Water Conservancy District, 677 P.2d 320 (Colo.1984). The evidence here supports the trial court’s conclusion that the parties intended the stipulated payments to carry the same interest rate as the promissory note and deed of trust.

D

Having determined that Martinez was unjustly enriched by the respondents, we must now consider the appropriate remedy. Although declaration of sub-rogation or the imposition of an equitable lien is appropriate when a junior lienor has paid toward senior liens, imposition of a quasi contract is also an appropriate restitutive remedy in these circumstances. 2 G. Palmer, The Law of Restitution § 10.5 (1978); Restatement (Second) of Restitution § 31 comment b (Tent. Draft No. 2, 1984). Either subrogation or the imposition of an equitable lien would place the respondents in the shoes of the lienors whom the respondents had paid, with all the attendant rights of enforcement on default. Typically, these two remedies have been applied in cases where only one party has been unjustly enriched. See, e.g., Graham v. Alcoves, Inc., 148 Colo. 379, 366 P.2d 375 (1961); Capitol National Bank v. Holmes, 43 Colo. 154, 95 P. 314 (1908); Coates v. Hewgley, 581 P.2d 929 (Okla.App.1978). Here, where both parties have been unjustly enriched, the use of quasi contract as the specific restitutive remedy allows the court to apply an equitable set-off. Award of such a set-off produces the salutary result that only one of the two parties owes financial reimbursement to the other, thereby promoting judicial economy by reducing the number of potential actions to enforce the judgment. We, therefore, conclude that imposition of the remedy of quasi contract is appropriate here, much as the trial court concluded. Any amounts the respondents owe Martinez for reasonable rental value of the Meade Street property may be reduced by an equitable set-off of the amounts Martinez owes the respondents for stipulated payments and payments toward senior liens and municipal utility bills. See Walter E. Heller & Co. v. Lindsey, 146 Colo. 452, 361 P.2d 979 (1961).

VI

The Court of Appeals apparently affirmed the trial court’s award to the respondents of reasonable attorney fees incurred in bringing the foreclosure action. The award was based on a clause in the deed of trust requiring Martinez to pay reasonable attorney fees in the event of foreclosure. We reverse.

Courts generally cannot award attorney fees in civil actions at common law unless specifically authorized by statute or contract. See, e.g., Hargreaves v. Skrbina, 635 P.2d 221 (Colo.App.1981), aff'd in part, 662 P.2d 1078 (Colo.1983) (reversed on grounds other than attorney fees); see generally Rowe, The Legal Theory of Attorney Fee Shifting: A Critical Overview, 1982 Duke L.J. 651. While there are no statutory provisions concerning specifically the award of attorney fees in foreclosure actions, the version of section 13-17-101, 6 C.R.S. (1983 Supp.), then in effect provided that a court could not award attorney fees unless the action by the adverse party was groundless or frivolous. The record does not support a conclusion that the character of this action was groundless or frivolous.

Section 13-17-102, 6 C.R.S. (1983 Supp.), also in effect at the time of trial, provided that the trial court could exercise its discretion in the award of attorney fees to avoid manifest injustice, and set forth several factors for consideration in making such determination. All of the factors but one, the financial conditions of the parties, tend to bear upon the character of the action as frivolous or groundless. The claims of Martinez, who has prevailed in part, cannot be characterized as more frivolous than those of the respondents. The record does not support the conclusion that the financial conditions of the parties mandate an award of attorney fees. There is no manifest injustice in the respondents paying their own attorney fees for prosecuting a foreclosure action which is barred.

In awarding attorney fees for the foreclosure action, the trial court relied upon the terms of the deed of trust. In view of our conclusion that the lien on the Meade Street property was extinguished prior to the commencement of the foreclosure action, the respondents are not entitled to attorney fees to enforce a nonexistent right. In construing a contract, one must consider the subject matter, the sense in which the parties naturally under-stood it at the time it was made and the purposes to be accomplished. Lorenzen v. Mustard’s Last Stand, Inc., 196 Colo. 265, 586 P.2d 12 (1978). To construe the deed of trust to require attorney fees for an action which is not maintainable would be contrary to the reasonable contractual purpose of protecting the mortgagee from incurring excessive expenses in vindicating a legitimate right to foreclose. Such a construction would also violate public policy proscribing the award of punitive damages in contract actions. See Weidman v. Tomaselli, 81 Misc.2d 328, 365 N.Y.S.2d 681, affd', 84 Misc.2d 782, 386 N.Y.S.2d 276 (Sup.Ct.1975). For these reasons, we conclude that the respondents cannot recover attorney fees.

VII

For the foregoing reasons, we affirm the judgment of the Court of Appeals insofar as it recognizes that a mortgagee cannot foreclose a deed of trust where any action on the underlying promissory note is barred by a statute of limitation, and insofar as it directs the trial court to conduct further proceedings to establish the appropriate sums to be paid. We reverse those portions of the Court of Appeals’ judgment holding that the doctrine of mortgagee in possession bars possession of the Meade Street Property by Martinez prior to the satisfaction of the underlying indebtedness and authorizing the respondents to recover their attorney fees from Martinez.

The judgment is affirmed in part and reversed in part, and the case is remanded to the trial court with directions to conduct further proceedings consistent with the views expressed in this opinion. 
      
      . Martinez also asserted claims for slander of title and for physical damage to the property during the period in which Myrick was in possession. These claims were dismissed by the trial court; we do not address them in this appeal.
     
      
      
        . Myrick also asserted a counterclaim based upon abuse of process. The Court of Appeals reversed the trial court’s dismissal of this claim. We do not address the claim in this appeal.
     
      
      . Although the trial court concluded that a reasonable time in which to institute foreclosure proceedings expired on July 1, 1972, it apparently did not see an inconsistency in awarding respondents a decree of foreclosure in a foreclosure action instituted in 1979.
     
      
      . The following issues were raised before the Court of Appeals: whether the lien was extinguished when action on the underlying debt was barred, whether the doctrine of laches should be applied, whether the right to foreclose existed after action on the underlying debt was barred, whether there was a discharge of the debt or an accord and satisfaction, whether attorney fees should have been awarded, whether the mortgagee was due sums spent on municipal utility bills, whether the trial court miscalculated the damages, whether the abuse of process counterclaim should be reinstated and whether the mortgagor was entitled to rent plus interest and, if so, at what rate.
     
      
      .Both the petitioner and the respondents assume that the Court of Appeals affirmed the trial court's award of attorney fees to respondents. Although Martinez specifically raised this issue in her appeal, the Court of Appeals’ opinion does not specifically address it. Rather, the opinion states that issues not specifically disposed of either are without merit or, in light of the ultimate holding, need not be addressed. It is not entirely clear whether the Court of Appeals in fact affirmed the trial court’s judgment on this issue, deeming Martinez’ argument to be without merit, or reversed in light of its holding that the trial court’s monetary award must be recalculated. We suppose the former result to be the more likely reflection of the intention of the Court of Appeals.
     
      
      . Although the evidence concerning default is disputed, there is evidence in the record to support the trial court’s finding that default occurred in 1968. In any event, the record indicates that default could have occurred no later than 1971, when the petitioner’s relatives vacated the Sheridan Boulevard property.
     
      
      . The original version of § 38-40-105 stated that an action must be brought within seven years, whereas under the current provision an action must be brought within fifteen years. See Act of Mar. 28, 1927, ch. 150, § 20, 1927 Colo.Sess.Laws 585, 595.
     
      
      . In some jurisdictions, a mortgagor in possession may not maintain an action in equity to quiet title until the underlying debt is paid even though actions to recover on the promissory note or to foreclose the mortgage are not maintainable. See, e.g., Mix v. Sodd, 126 Cal.App.3d 386, 178 Cal.Rptr. 736 (1981). This result is predicated upon the notion that a statute of limitation in no way releases a debtor from the moral obligation to pay the debt and, therefore, that a court of equity will not aid the debtor in avoiding payment of the debt. This result severely undermines the purpose behind a statute of limitation and, in Colorado, is contrary to the statutory scheme adopted by the General Assembly concerning mortgages.
      As this court noted in Colorado State Bd. of Medical Examiners v. Jorgensen, 198 Colo. 275, 599 P.2d 869 (1979), the purpose of a statute of limitation is to promote justice, discourage unnecessary delay and forestall' prosecution of stale claims. Here, unnecessary delay would be encouraged and prosecution of stale claims would not be forestalled if mortgagees were allowed to recover in equity for a debt long barred. Furthermore, under § 38-40-112, a lien is extinguished when an action on the underlying note can no longer be maintained. To allow the respondents to retain a legal or equitable lien upon the petitioner’s title based on nonpayment of the barred debt would render § 38-40-112 meaningless. Accord Mills v. Reneau, 411 P.2d 516 (Okla.1965) (decided under similar statutory provisions): see generally 3 R. Powell, The Law of Real Property ¶ 461 (1986).
     
      
      . In the course of making its findings that the property here had not been abandoned, the trial court correctly noted that as a matter of law the concept of abandonment has little application to real property. The general rule is that, in the absence of adverse possession, title to real property cannot be divested by abandonment. See generally 1 Am.Jur.2d Abandoned, Lost and Unclaimed Property § 13 (1962 & 1986 Supp.); see, e.g., Hunter v. Schultz, 240 Cal.App.2d 24, 49 Cal.Rptr. 315 (1966); Town of Marne v. Goeken, 259 Iowa 1375, 147 N.W.2d 218 (1966).
      The General Assembly has not defined the term “abandoned” for purposes of § 38-39-112(2). We need not decide whether the General Assembly intended to allow the mortgagee to take possession in situations involving something less than relinquishment of permanent control and ownership by the mortgagor, because we conclude that there is sufficient independent basis to determine that the mortgagee here does not meet the requirements of § 38-39-112. The respondents here had not commenced foreclosure proceedings at the time they went into possession and, therefore, had no right to possession under § 38-39-112(2).
     
      
      . The relevant portion of the deed of trust states as follows:
      THAT IN CASE OF ANY DEFAULT, Whereby the right of foreclosure occurs hereunder ... the holder of said note ... shall at once become entitled to the possession, use and enjoyment of the property aforesaid, and to the rents issues and profits thereof, from the accruing of such right and during the pendency of foreclosure proceedings and the period of redemption, if any there be.
      (emphasis added).
     
      
      . See supra note 10.
     
      
      . Application of the doctrine of unjust enrichment does not depend upon the existence of a contract, either express or implied in fact. Rather, a contract implied by operation of law, a quasi contract, may be used to avoid the unjust enrichment of one or more of the parties. Cablevision of Breckenridge v. Tannhauser Condominium Association, 649 P.2d 1093 (Colo.1982); Valley Realty & Investment Co. v. McMillan, 160 Colo. 109, 414 P.2d 486 (1966); Wistrand v. Leach Realty Co., 147 Colo. 573, 364 P.2d 396 (1961); see generally 1 G. Palmer, The Law of Restitution § 1.2 (1978).
     
      
      . The respondents, in their counterclaim, did not label their cause of action as one based upon a theory of unjust enrichment, nor did they specifically seek restitution. However, the substance of a claim, rather than the title, is controlling. Hutchinson v. Hutchinson, 149 Colo. 38, 367 P.2d 594 (1961); People ex rel. Cory v. Colorado High School Activities Association, 141 Colo. 382, 349 P.2d 381 (1960). The respondents here clearly sought reimbursement for payments made by them to the benefit of Martinez and argued on appeal that Martinez would be unjustly enriched if not compelled to disgorge the value of those payments. Further, Martinez clearly stated an equitable claim based upon unjust enrichment. One of the fundamental principles of equity is that one may not obtain equitable relief without doing equity. See, e.g., Fidelity Finance Co. v. Groff, 124 Colo. 223, 235 P.2d 994 (1951). For these reasons, the issue of unjust enrichment of Martinez is properly before this court.
     
      
      . The deed of trust provided that if Martinez failed to pay taxes, assessments or liens, any such payments made by the respondents would be added to the indebtedness. The instrument is inapplicable here, however, because its terms provided that repayment of the respondents would be "out of the proceeds of the sale of the property_”
     
      
      . Although the trial court did not expressly predicate its ruling on a quasi contract remedy, its ruling clearly approximated the same result.
     
      
      . See supra note 5.
     
      
      .Section 13-17-101 provided:
      Attorney fees. (1) Subject to the provisions of subsections (2) and (3) of this section, in any suit involving money damages in any court of this state, the court shall award, except as this part 1 otherwise provides, as part of its judgment and in addition to any costs otherwise assessed, reasonable attorney fees.
      (2) When the court determines that a person is entitled to reasonable attorney fees under subsection (1) of this section, it shall allocate the payment thereof among the parties as it deems most just and may charge such amount or portion thereof to any party whether or not there was a money judgment rendered against such party.
      (3) The court shall not award attorney fees among the parties unless it finds that the bringing, maintaining, or defense of the action against the party entitled to such award was frivolous or groundless. The court must make findings either affirmative or negative as to the matters set forth in this subsection (3).
      (4) A party shall also not be charged any attorney fees under subsection (1) of this section if, after exercising reasonable and diligent efforts after filing of suit, such party files a voluntary dismissal concerning the person who may have been entitled to attorney fees within a reasonable' time after determining the person would not be found to be liable for damages.
      Sections 13-17-101 to -103 were repealed and reenacted in amended form in 1984. The current version, §§ 13-17-101 to -103, 6 C.R.S. (1986 Supp.), is inapplicable to civil actions, such as the instant one, commenced before July 1, 1984. Act of Apr. 27, 1984, ch. 107, § 7, 1984 Colo.Sess.Laws 460.
     
      
      . Section 13-17-102 stated as follows:
      Procedure for determining reasonable fee — judicial discretion. (1) The determination of whether or not a person is entitled to receive reasonable attorney fees and the amount which constitutes a reasonable award of an attorney fee in a given case shall be made by the court which has granted the dismissal of a party or has entered the judgment, decree, or order disposing of the action at the time of such entry or at a subsequent time fixed by the court. The court may exercise its discretion in determining whether attorney fees are to be awarded and as to the amount thereof so that manifest injustice may be avoided. When such discretion is exercised, the reasons therefor shall be specifically stated in the judgment or order of court. The following factors among others shall be taken into consideration in making such determinations:
      (a) In the case of parties claiming adversely to a person entitled to attorney fees under section 13-17-101(1), the extent of any efforts made to determine the truth of such adverse claim before making such claim or during pretrial proceedings or both;
      (b) The extent to which a party has made available facts to indicate his nonliability for any money damages;
      (c) The financial conditions of the parties;
      (d) That a particular party has prosecuted or defended the case in bad faith or abused the procedures set forth in the Colorado rules of civil procedure;
      (e) Whether there were issues of fact determinative of such person’s liability concerning which evidence was in conflict.
     
      
      . In Western United Realty, Inc. v. Isaacs, 679 P.2d 1063 (Colo.1984), this court concluded that under § 13-17-101, 6 C.R.S. (1983 Supp.), an action should be considered frivolous if the proponent can present no rational argument based on the evidence or law in support of the proponent’s claim or defense and should be considered groundless if it is not supported by any credible evidence at trial. We note that the Isaacs’ standard, formulated subsequent to trial in this case, would not mandate a contrary result here.
     