delivered the Opinion of the Court.
I. Introduction
We granted certiorari to decide whether the court of appeals erred in holding that an attorney must return fees received for legal services when the services were successfully completed but the agreement was not in writing. The court of appeals ordered attorney Steven Mullens to return fees earned during representation of Victoria Hansel-Henderson in claims against her former employer because the underlying contingent fee agreement did not comply with the requirements of Colorado Rules of Civil Procedure Chapter 23.3, and was therefore unenforceable. We hold that an attorney is entitled to fees under quantum meruit when the agreed upon services are successfully completed but the contingent fee agreement is not in writing. Therefore, we reverse and remand the ease to the court of appeals with directions to decide any remaining issues in accordance with the views expressed in this opinion.
II. Facts and Procedural History
In 1990, respondent Victoria Hansel-Henderson1 entered into a written contingent fee agreement with petitioner Steven Mullens, a Colorado attorney with over twenty years experience in Workers’ Compensation claims. Under the terms of this initial contract, Mullens agreed to represent Hansel in a Workers’ Compensation claim against her employer Public Service Company for injuries sustained on the job. In exchange for representation, Mullens would receive twenty percent (20%) of any monies received by him on her behalf. Mullens agreed to carry all costs related to this litigation.
As Mullens worked on the Workers’ Compensation claim over the next two years, he learned of attempts by Public Service Company to influence medical diagnoses being made for purposes of evaluating Hansel’s injuries. Mullens recognized that these tac*994tics supported a potential Bad Faith claim for the intentional mishandling and manipulation of the Workers’ Compensation claim. Mul-lens discussed this potential claim with Hansel and the two agreed that he would also represent her in this Bad Faith claim for an additional fee. Although testimony regarding the precise fee to be paid under this new agreement varied somewhat, the trial court found that Mullens and Hansel had an agreement for a fee of forty percent (40%) of any monies received for this new claim.2 This separate agreement was never committed to writing.
In 1993, after three years of work, Mullens settled the two claims. The employer agreed to pay Hansel $37,560 to settle the Workers’ Compensation claim and $262,440 to settle the Bad Faith claim for a total on the two claims of $300,000. From the settlement amounts Mullens retained thirty-three percent (33%) of the total settlement amount, instead of twenty percent (20%) of the Workers’ Compensation claim and forty percent (40%) of the Bad Faith claim.3 This arrangement allowed Hansel to receive $12,488 more than she could have expected to receive under the terms of the oral contingent fee agreement. Hansel accepted the amounts and signed two documents, one for each claim, releasing the employer from further liability. The trial court found that at disbursement Hansel was very pleased with the outcome of the claims and did not object to the amounts of attorney’s fees. Hansel negotiated the settlement checks.
In 1995, two years after Mullens received his attorney’s fees and Hansel accepted the settlement money, Hansel initiated action against Mullens to recover all of the attorney’s fees paid for the Bad Faith settlement. Hansel asserted in her complaint that Mul-lens was not entitled to attorney’s fees from the Bad Faith settlement because the contingent fee agreement for the Bad Faith claim was not in writing as required by Colorado Rules of Civil Procedure Chapter 23.3, and was therefore not enforceable.4 Hansel argued that because Mullens was not entitled to payment under an oral contingent fee agreement, Mullens should be required to return to Hansel all of the attorney fees that she paid for the Bad Faith-claim.5
After finding an oral agreement for forty percent (40%) of all settlement monies on the Bad Faith claim, the trial court held that the agreement was not enforceable because it was never reduced to writing as required by Chapter 23.3. However, the court determined that the fees collected by Mullens were reasonable for the services performed and allowed Mullens to retain fees under quantum meruit. Hansel appealed the trial court holding allowing Mullens to retain the fees acquired from the settlement of the Bad Faith claim.
On appeal, the court of appeals decided that Dudding v. Norton Frickey & Assoc., 11 P.3d 441 (Colo.2000), controlled. According *995to the court of appeals, Dudding holds that under Chapter 23.3, Rule 5(d), there can be no recovery under quantum meruit where the underlying contingent fee agreement fails, unless the agreement contains a statement clearly giving the client notice that she may be liable to pay compensation to the attorney under quantum meruit. Because the court of appeals found no evidence of any notification that recovery under quantum me-ruit might be possible, the court of appeals reversed the trial court’s judgment.
Since we have not had the opportunity to examine whether quantum meruit recovery is available for unenforceable contingent fee agreements where the agreed upon legal services have been completed, and because Chapter 23.3 does not specifically answer this question, we granted certiorari. After considering this issue we conclude that the rule in Dudding applies only to those situations where the attorney-client relationship terminates before the agreed upon legal services are completed. Because the court of appeals’ application of Dudding is overly broad, we reverse.
III. Analysis
This case requires us to examine whether an attorney may keep attorney’s fees paid for services performed pursuant to an unenforceable oral contingent fee agreement when the services were successfully completed.6 Our examination of this issue is broken into three areas. First, we consider how attorney’s fees under unenforceable contingent fee agreements are limited by our rules. Specifically, we examine the Rule 5(d) notice requirement found in Chapter 23.3 of Colorado Rules of Civil Procedure, and the example of this notice provided in Rule 7. Second, we address whether our earlier decisions resolve the issue now before us. Finally, we examine quantum meruit and the function of the Rule 5(d) limitation in the context of a contingent fee agreement where the legal services were successfully completed.
A. Rules Governing Contingent Fees
Whether or not the terms of a contingent fee agreement are enforceable is controlled by Chapter 23.3 of Colorado Rules of Civil Procedure. Rule 6 of Chapter 23.3 states that “no contingent fee agreement shall be enforceable by the involved attorney unless there has been substantial compliance with all of the provisions of this chapter.” C.R.C.P. Ch. 23.3, Rule 6. Hence, if a contingent fee agreement fails to substantially comply with the rules of Chapter 23.3, it is unenforceable.
According to Rule 1, a contingent fee agreement must be in writing. C.R.C.P. Ch. 23.3, Rule 1; Beeson v. Indus. Claim Appeals Office, 942 P.2d 1314, 1316 (Colo.App.1997). Therefore, an oral contingent fee agreement is not enforceable and the attorney cannot recover the fee amount specified in the oral agreement. This, however, does not necessarily preclude the attorney from recovering fees altogether. Generally attorneys may recover on an unenforceable contract on the basis of quantum meruit. Restatement (Third) of the Law Governing Lawyers § 39 (2002) (If a client and lawyer have not made a valid contract providing for another measure of compensation, a client owes a lawyer who has performed legal services for the client the fair value of the lawyer’s services); 7 Am.Jur.2d § 289 (attorneys may recover on a quantum meruit basis even where the parties have entered an unenforceable fee contract).
Although recovery under quantum meruit is generally allowed for unenforceable fee agreements, Chapter 23.3 limits such recovery. Elliott v. Joyce, 889 P.2d 43, 46 (Colo.1994). Chapter 23.3 limits compensation under quantum meruit through a notice requirement detailed in Rule 5(d). Rule 5(d) mandates that contingent fee agreements contain “a statement of the contingency upon which the client is to be liable to pay compen*996sation otherwise than from amounts collected for him by the attorney.”7 C.R.C.P. Ch. 23.3, Rule 5(d). If the client is to be required to pay the attorney from monies not obtained for the client by the attorney through settlement or judgment, the fee agreement must contain a statement giving the client notice of such a possibility.
The limitation that Rule 5(d) imposes on quantum meruit is central to our discussion. Hansel argues that Rule 5(d) requires that for there to be any compensation under quantum meruit, there must be notice of the possibility of liability under quantum meruit in the contingent fee agreement. Hansel argues that without such notice of potential quantum meruit recovery, Mullens cannot receive any payment under quantum meruit for legal services that resulted in a settlement of the Bad Faith claim. Thus, the initial question before us is whether Rule 5(d) broadly applies to limit any compensation of attorney’s fees under quantum meruit when the agreed upon legal services have been completed. In answering this question we look to Form 2 in Rule 7 to enhance our understanding of Rule 5(d).
Chapter 23.3, Rule 7, entitled Forms, offers two examples of conforming contingent fee agreements.8 Form 2, subsection 3 is an example of how the quantum meruit notice statement should be drafted in order to allow for quantum meruit recovery.9 C.R.C.P. Ch. 23.3, Rule 7, Committee Comment. The example is significant in that by stating when compensation under quantum meruit is allowed, it demonstrates that the Rule 5(d) notice requirement applies to situations where the attorney-client relationship terminates before the agreed upon legal services are completed. Subsection 3 states in pertinent part:
The client is not to be liable to pay compensation otherwise than from amounts collected for the client by the attorney, except as follows:
In the event that the client terminates this contingent fee agreement without wrongful conduct by the attorney ... or if the attorney justifiably withdraws from the representation, the attorney may ask the court ... to order the client to pay the attorney a fee based upon the reasonable value of the services provided by the attorney.10
C.R.C.P. Ch. 23.3, Rule 7, Form 2, subsection 3. As stated, this example of a notice statement demonstrates that the Rule 5(d) notice requirement applies when the client terminates the agreement without wrongful conduct by the attorney, or the attorney justifiably withdraws from representation, before the agreed upon legal services are completed.
*997Form 2 of Rule 7 has no application where the attorney-client relationship is not terminated prematurely. Where the attorney-client relationship is not terminated prematurely and the agreed upon services are completed, as is the ease here, the notice requirement as given in Form 2 of Rule 7, does not notify the client whether the attorney is entitled to compensation. Rather, it is the contingent fee agreement itself that provides the client notice that compensation is expected when the legal services are completed.
Specifically, the language in both Rule 5(d) and Form 2 of Rule 7, “... otherwise than from amounts collected for him by the attorney,” serves to limit the application of Rule 5(d) to cases where the attorney-client relationship is terminated before the attorney collects a recovery for the client. The client, under the contingent fee agreement itself, has notice that once the attorney obtains a recovery for the client, the client must compensate the attorney for his services. Thus, the example in Rule 7 helps to explain that the Rule 5(d) notice requirement does not apply to situations where the agreed upon legal services have been completed. Although we have not previously examined this issue, our conclusion is supported by our prior cases.
B. Elliott and Dudding
Two prior decisions of this court hold that the Rule 5(d) notice requirement works to limit quantum meruit recovery of attorney’s fees, when the agreed upon legal services have not been completed because of termination of the attorney-client relationship. In Elliott v. Joyce, 889 P.2d 43 (Colo.1994), we held that where there is a contingent fee agreement and the attorney voluntarily withdraws from representation prior to completing the contingency of the fee agreement, the attorney may recover under quantum meruit only if that possibility is outlined in the fee agreement or a subsequent written agreement. Elliott, 889 P.2d at 45.
In Elliott, attorney Elliott and client Joyce entered into a written contingent fee agreement. After Elliott expended about 120 hours of time on Joyce’s behalf, Elliott moved to withdraw from the case. The motion was granted and Joyce retained new counsel who was able to obtain a settlement. Elliott then sought attorney’s fees based on quantum meruit for the time and efforts he expended on Joyce’s behalf. Applying Rule 5(d), we held that where an attorney voluntarily abandons the contingent fee agreement by withdrawing from representation, there can be no recovery in quantum meruit unless the client’s possible liability is expressly stated in the agreement. Id. at 45. We did so because without notice to the contrary, a client has no expectation to pay if the attorney withdraws prior to completion of the work agreed upon. Id. at 46. Therefore, for the attorney to be compensated under quantum meruit where the agreed upon services are not completed, it must be shown that in the agreement the client had notice of this potential liability to the attorney in the event that the services were not completed.
Citing our Rule 5(d) analysis in Elliott, in Dudding v. Norton Frickey & Assoc, we determined that although recovery for fees under a theory of quantum meruit generally exists for attorneys, it was not available because Dudding did not have notice that Norton Frickey & Associates could seek such recovery. Dudding, 11 P.3d at 444.
In Dudding, client Dudding and attorneys with Norton Frickey & Associates entered into a written contingent fee agreement which set forth the conditions of payment as a percentage of damages recovered for representation in a wrongful termination suit against Dudding’s employer. The agreement did not address any payment in the event that Dudding was reinstated in his employment and no monies were recovered. Although, Norton Frickey attorneys filed suit on Dudding’s behalf, Dudding independently settled the case, obtaining reinstatement in his employment without the assistance of his attorneys. In Dudding, as in Elliott, the attorneys did not recover the monies from which the contingency fee was to be paid.
In the case before us, the court of appeals based its decision on Dudding. Quoting Dudding, the court of appeals stated that “attorneys may seek quantum meruit recovery even when a contingent fee contract fails, provided that the attorney gave the client *998some notice in writing of the possibility of a quantum meruit claim.” Id. at 449. In the case before us Mullens did not provide Hansel with written notice that payment for legal services was required even if the services were not completed. Hence, based on this language from Dudding the court of appeals determined that Mullens was not entitled to attorney’s fees under quantum meruit.
We believe that our holding in Dudding is limited to those circumstances where the attorney has failed to substantially perform the agreed upon legal services. We specifically recognized this limitation in Dudding by stating “[t]he ease before us today does not encompass the question of whether substantial performance of the agreement entitles the attorney to the full contingent fee.”11 Therefore, we conclude that the rule in Dud-ding, and in Elliott, does not apply to those situations where the agreed upon services have been completed.
C. Quantum Meruit When the Legal Services are Completed
We have never before examined whether the Rule 5(d) notice requirement applies to situations where the agreed upon legal services, such as a settlement or judgment, have been completed. However, the court of appeals explored such a situation in Beeson v. Indus. Claim Appeals Office, 942 P.2d 1314 (Colo.App.1997).
In Beeson, the contested fees arose from an oral contingent fee agreement where attorney Fogel had obtained a settlement for client Beeson, thereby completing the contingency of the contract. Beeson, 942 P.2d at 1315. Two years after accepting the distribution of funds, Beeson sought to retrieve her payment of attorney’s fees because the fee agreement failed to comply with Chapter 23.3, and hence the contract was unenforceable. Id. at 1315-16. Under the unenforceable contract, Beeson reasoned, Fogel should not have received the bargained-for amount. Id. at 1315. In Beeson, the court of appeals agreed that the underlying contingent fee agreement was unenforceable, however, the court allowed Fogel to be compensated for his services under a quantum meruit analysis. Id. at 1316.
The Beeson court determined that fees may be recovered on the basis of quantum meruit so long as the attorney shows that a benefit was conferred, appreciated, and accepted by the client under such circumstances that it would be inequitable for the benefit to be retained without payment of its value. Id. Because the services agreed upon in the unenforceable oral agreement were completed, the Rule 5(d) notice requirement was not applicable. Id. Specifically, the Bee-son court reasoned that because Fogel was not seeking fees after having been terminated by the client; because Fogel had not unilaterally withdrawn while the claim was pending; and because he had fully performed the requested services, completely resolving the matter, he was entitled to reasonable compensation for his work. Id. We agree with the analysis of the court of appeals in Beeson in light of the nature of contingent fee agreements and the function the Rule 5(d) notice requirement serves.
The notice requirement fulfills an important function. The purpose of Rule 5(d) is to assure that the client knows whether she will be liable for attorney’s fees under quantum meruit when there is not already an expectation to pay. In a contingent fee relationship, the client is put on notice by the nature of the contingent fee agreement itself that should the attorney fulfill his end of the bargain to the benefit of the client, the client will be required to pay the attorney from the funds the attorney receives for the client. Hence, where the agreed upon legal services are completed, the client has the expectation that she must pay the attorney. This expectation exists even if the fee agreement is later found unenforceable because it is not in writing. Since the client already has an expectation that she must pay the attorney from the monies the attorney recovers for her, requiring a statement expressing such does not advance the essential function of Rule 5(d) of giving the client notice as to her potential liability.
In contrast, if the agreed upon legal services are not completed, the client will have *999no notice that she may be expected to pay the attorney. The expectation to pay for services that have not been completed will arise only if there is express notice of such an obligation. Only in situations where the attorney fails to complete the agreed upon services, and the client therefore has no expectation of needing to pay, is the presence of the notice statement meaningful.
When an attorney completes the legal services for which he was retained, the fact that the underlying fee agreement was unenforceable does not in itself preclude the attorney from being paid the reasonable value of his services. When a contract fails, equity steps in to prevent one party from taking advantage of another. Quantum me-ruit, founded upon the principle of equity, exists to prevent unjust enrichment. D. Dobbs, Handbook on the Law of Remedies, § 4.2 (1973); 1 D. Dobbs, Law of Remedies § 4.2(3) (2d ed.1993). Not allowing an attorney to receive reasonable payment for completing legal services agreed to by both the attorney and client to the benefit of the client, under a good faith belief that he would receive an agreed upon compensation for his services, solely because the contract was not in writing is inequitable and unjustly enriches the client.
In her complaint Hansel asserts a claim for “money had and received,” under which she argues that all fees retained by Mullens should be returned to her.12 Under this principle, a party will not be allowed to keep money which in equity and good conscience should be returned to another. D. Dobbs, Handbook on the Law of Remedies, § 4.2 (1973). Under the claim “money had and received” the task of the court is not to determine whether something was taken away from the client but whether the attorney was unjustly enriched by wronging the client, such as accepting payment he was not entitled to. Recovery Based on Tortfeasor’s Profits in Action for Procuring Breach of Contract, 5 A.L.R.4th 1276 (2002); D. Dobbs, Handbook on the Law of Remedies, § 4.2 (1973).
“Money had and received,” like quantum meruit, exists to prevent unjust enrichment. In the circumstances before us, “money had and received” operates to return funds to a client from an attorney who has been unjustly enriched. Quantum meruit, on the other hand, assists the attorney in obtaining fees from the client to prevent unjust enrichment of the client. The difference between the two doctrines in the circumstances before us is merely whether the fees have been received by the attorney. Both doctrines seek to prevent unjust enrichment in the attorney-client relationship, and to determine the reasonable value of the legal services rendered. For this reason, our discussion of quantum meruit completely resolves the claim for “money had and received.”
Neither the Rules Governing Contingency Fees under Chapter 23.3 nor our prior cases maintain that equity is unavailable to the attorney who completes the agreed upon legal services solely because the agreement was not in writing. Further, the client has notice that she must pay for legal services because she agreed to do so from the monies recovered by the attorney on her behalf. Here, Hansel agreed to pay for legal services from the monies her attorney recovered. Mullens completed the agreed upon legal services, thereby obtaining a substantial settlement for Hansel. While it is true that Mullens may not enforce the terms of the contingent fee agreement, we find that he may be compensated under quantum meruit for the reasonable worth of the legal services he provided to Hansel.
IV. Conclusion
We hold that Mullens earned reasonable attorney fees, despite an unenforceable contingency agreement, under quantum meruit. Thus, we reverse the judgment of the court *1000of appeals and remand for the court to decide any remaining issues consistent with this opinion.
Justice KOURLIS dissents, and Justice RICE joins in the dissent. Justice BENDER does not participate.. Referred to throughout opinion as "Hansel," following respondent’s example in her opening brief.
. Hansel admitted she retained Mullens to represent her on this new claim, and that she expected to pay for his services. However, she claimed that the terms of the fee agreement were not clear to her. In contrast, Mullens testified that Hansel agreed to a fee of forty percent (40%) of any monies received. The trial court found that "[t]he testimony presented was that the Defendant (Mullens) discussed a 40% fee for any monies that may be received out of this separate claim. During her testimony at trial, the Plaintiff (Hansel) stated she did not remember whether such an oral contract was entered into, but the testimony of the Defendant was unequivocal on this issue and the Court will find that such a conversation, agreed to by the Defendant, did occur.”
. Attorney’s fees for Mullens included $12,520 from the Workers’ Compensation claim and $87,480 from the Bad Faith claim. Subtracting costs, Hansel received slightly less than $200,000.
. In her complaint. Hansel claimed that Mullens was only entitled to twenty percent (20%) of the Worker’s Compensation settlement, not thirty-three percent (33%), as agreed to in the written contingent fee agreement. The trial court agreed with Hansel and awarded her the difference between the thirty-three percent (33%) taken and the twenly percent (20%) specified in the written contingent fee agreement. The fee on the Workers' Compensation claim is not an issue on appeal.
. Hansel's argument that Mullens should receive nothing because the agreement was unenforceable contradicts her testimony at trial where she admitted that Mullens deserved to be paid for the services he performed and that prior to settlement she had in fact expected to pay him.
. Issue as stated in Petition for Certiorari upon which certiorari was granted: "Whether the Colorado court of appeals erred in holding an attorney, who has satisfactorily completed a retention in the good faith belief that he had an enforceable contingency fee agreement, and the client fully paid the fee and accepted settlement funds without complaint, must later refund the fee when, long after the- cases ended, the client first complained only that the fee contract was not in writing.”
. Rule 5(d) existed in its current form prior to the initiation of the attorney-client relationship between Mullens and Hansel, and has remained unchanged throughout the evolution of this case. Rule 5(f) and Rule 6 were amended effective November 16, 1995, and July 1, 2001, to include more specific cross-references. However, the meaning of these rules did not change and, in any event, the changes do not affect this case.
. Form 1 does not offer any example of the notice statement.
. Form 2, subsection 3 was adopted in its present form on May 24, 2001, and became effective July 1, 2001. Prior to that, Rule 7 did not include an example of the notice statement.
. Subsection 3 in its entirety is as follows: The client is not to be liable to pay compensation otherwise than from amounts collected for the client by the attorney, except as follows: In the event that the client terminates this contingent fee agreement without wrongful conduct by the attorney which would cause the attorney to forfeit any fee, or if the attorney justifiably withdraws from the representation, the attorney may ask the court or other tribunal to order the client to pay the attorney a fee based upon the reasonable value of the services provided by the attorney. If the attorney and client cannot agree how the attorney is to be compensated in this circumstance, the attorney will request the court or other tribunal to determine: (l) if the client has been unfairly or unjustly enriched if the client does not pay a fee to the attorney; and (2) the amount of the fee owed, taking into account the nature and complexity of the client's case, the time and skill devoted to the client's case by the attorney, and the benefit obtained by the client as a result of the attorney’s efforts. Any such fee shall be payable only out of the gross recovery obtained by or on behalf of the client and the amount of such fee shall not be greater than the fee that would have been earned by the attorney if the contingency described in this contingent fee agreement had occurred.
C.R.C.P. Chapter 23.3, Rule 7, Form 2, subsection 3.
. Dudding v. Norton Frickey & Assoc., 11 P.3d 441, 448 n. 5 (Colo.2000).
. In his brief, Mullens alleged that Hansel is really asserting a claim for disgorgement based on malfeasance. Partial or complete forfeiture of attorney’s fees may be required when an attorney engages in a "clear and serious violation of duty to a client.” Restatement of the Law Gov-eming Lawyers, § 37 (2002). Hansel has never alleged any misconduct on the part of Mullens other than failing to put the agreement in writing. As such, disgorgement of fees does not apply to this case.