
645 S.W.2d 550 (1982)
Robert D. ALLEN, Independent Executor of Samuel W. Berrey, Deceased, Appellant,
v.
Mary J. BERREY and Jeanne Marie Wilson, Appellees.
No. 04-82-00132-CV.
Court of Appeals of Texas, San Antonio.
December 1, 1982.
Rehearing Denied January 12, 1983.
*551 Michael Woods Wagner, San Antonio, for appellant.
Lawrence Linnartz and William Gremillion, San Antonio, for appellees.
Before CLARK, CANTU and BASKIN, JJ.

OPINION
BASKIN, Justice.
This is a suit for declaratory judgment by an independent executor against the two devisees and legatees under a will for executor's fees in excess of the amount specified by the will. A county court at law in Bexar County, sitting as a probate court, granted summary judgment to the devisees, and the independent executor appeals. The parties will be denominated as they were in the probate court.
Samuel W. Berrey died testate, leaving his entire estate to his wife, Mary Berrey, and to his sister, Jeanne Wilson. Paragraph V of decedent's will provided:
I hereby constitute and appoint Robert D. Allen, Independent Executor of my will and estate, and I direct that no bond shall be required of him, and that no other action shall be had in the County Court in relation to the settlement of my estate than the probating and recording of this my will and the return of statutory inventory, appraisement and list of claims. I further direct that Robert D. Allen shall be paid the sum of $20,000.00 for his services as Executor of my estate.
Robert D. Allen qualified as independent executor and took control of the estate upon admission of decedent's will to probate on February 2, 1976. He filed this action against defendants on August 24, 1981, in his capacity as independent executor, alleging that most of the work of administering the estate was completed and that he expected to be able to make final disbursements to the defendants in the near future.
Plaintiff alleged that the value of decedent's estate was valued in excess of $1,190,000.00 in 1976 and that in his capacity as independent executor, he had received monies and paid out monies as evidenced by a copy of his record (handwritten) of estate income and expenses attached to his petition. In his original petition plaintiff alleged that as executor he had received $580,392.92 and paid out $298,553.50. He also alleged that he had managed a 1986.84 acre ranch in Atascosa County and had negotiated grazing and hunting leases on the ranch. He further alleged that he had defended seven legal actions, reduced various notes to liquid form, managed other *552 properties and performed other services necessary to the administration of the estate. Acknowledging the $20,000.00 fee for his services set by decedent in Paragraph V of the will, plaintiff pleaded that he has performed services of a value far in excess of $20,000.00 and that he should be compensated on the statutory basis of 5% of the money received and 5% of the money paid out. He in addition claimed that defendants, as the sole beneficiaries, would be unjustly enriched if they or the estate did not compensate him for services rendered to the estate, suggesting that if he had not acted, any subsequent executor or administrator would have been entitled to receive compensation at the rate set by section 241 of the Probate Code. Finally, in addition to his record of receipts and expenditures, plaintiff attached a copy of decedent's will to his petition.
In their motion for summary judgment, defendants insisted that they were entitled to judgment on plaintiff's cause of action as a matter of law because by accepting the office of independent executor under a will specifying his compensation, plaintiff was bound by that clause in the will. In support of their motion, defendants pleaded reliance upon the pleadings in the case, the attachments thereto, any affidavits which were already or might thereafter be filed, and the case law applicable to the case. Defendants themselves filed no affidavits.
Plaintiff filed an answer to the motion for summary judgment in which he claimed that there existed fact questions as to whether (1) there was mutual mistake as to the fee allowed in the will; (2) defendants were unjustly enriched at his expense; and (3) he was entitled to recover from the estate on the theory of quantum meruit. We note at the outset that he did not plead mutual mistake nor quantum meruit in any of his three petitions. Because defendants did not except, however, we shall consider those points as though they had been raised by petition.
All parties have recognized the existence of the will and have alluded to Paragraph V. The will itself is before us only as part of plaintiff's second amended petition. Since all parties seem to agree on the existence and validity of the attached will, and also because the will was a document admitted to probate in the court below, we shall consider it to be proper summary judgment evidence. See Cogdell v. Fort Worth National Bank, 544 S.W.2d 825 (Tex. Civ.App.-Eastland 1976, writ ref'd n.r.e.), cert. denied, 434 U.S. 923, 98 S.Ct. 400, 54 L.Ed.2d 280 (1977).
On appeal, plaintiff asserts that the trial court erred in granting summary judgment on the grounds of unjust enrichment (he also argues quantum meruit under his first point of error), mutual mistake, and that it deprives him of determination of fact issues.
All parties recognize that the case of Stanley v. Henderson, 139 Tex. 160, 162 S.W.2d 95 (1942) is the leading and essentially only case dealing directly with the question of whether an independent executor, acting under a will which states his compensation, may receive the statutory amount that he otherwise would be entitled to receive. The court in Stanley, faced with that question, answered it:
So it results that we have language as plain as can be used that the executor shall take fifteen hundred dollars as compensation for his services. Henderson acceded to his office of executor and enjoyed its privileges and emoluments by virtue of the will of L.N. Stanley. Since he was willing to enjoy its benefits, he must bear its burdens. He cannot accept the one and reject the other. He entered upon his office in the face of the plain priviso that its material returns to him were limited to the sum of $1,500, so he cannot be heard now to complain that that sum is inadequate. He knew the size and character of the estate and, doubtless, something of the debts it owed. He could have refused to serve, but he chose otherwise. He made his bargain and he must abide it. Therefore, we sustain petitioners' points of error 1 to 4, inclusive, and hold that Henderson's compensation is fixed by the will at $1,500, *553 and that the provisions of the statute which would otherwise fix the same have no application. [Citations omitted.]
Id. 162 S.W.2d at 97. The doctrine announced in Stanley lives on. The court, in In re Estate of Roots, 596 S.W.2d 240 (Tex. Civ.App.-Amarillo 1980, no writ), wrote:
Equally established has been the right and the power of a testator to select the independent executor of his choice, Boyles v. Gresham, 158 Tex. 158, 309 S.W.2d 50, 53 (1958), and to denominate the amount of his compensation or permit it to be the amount set by statute.
Id. at 243. Plaintiff, as did the executor in Stanley, entered into an express contract when he accepted his office, and the summary judgment must stand unless the defensive issues raised by plaintiff will raise an issue of material fact.
"Unjust enrichment" characterizes the result or failure to make restitution of benefits received under such circumstances as to give rise to implied or quasi-contract to repay. It may be defined as "the unjust retention of a benefit to the loss of another, or the retention of money or property of another against the fundamental principles of justice or equity and good conscience." Fun Time Centers, Inc. v. Continental National Bank, 517 S.W.2d 877, 884 (Tex.Civ. App.-Tyler 1974, writ ref'd n.r.e.). Similarly,
The right to recover in quantum meruit is based on a promise implied by law to pay for beneficial services rendered and knowingly accepted. Davidson v. Clearman, 391 S.W.2d 48 (Tex.1965). If a valid express contract governing the subject matter exists there can be no recovery upon a contract implied by law. Woodard v. Southwest States, Inc., 384 S.W.2d 674 (Tex.1964).
Black Lake Pipe Line Co. v. Union Construction Co., 538 S.W.2d 80, 86 (Tex.1976).
We have held that plaintiff, when he agreed to become independent executor, entered into an express contract and we hold that he was bound by his bargain. Recovery of any amount greater than $20,000.00 on an equitable theory of implied contract, expressed in terms of quantum meruit or unjust enrichment, would, as a matter of law, be inconsistent with his recovery on the express contract. Point of error number one is overruled.
By his second point of error, plaintiff offers a defense of mutual mistake. In his affidavit, to which he attached a 227-page log of his activities as independent executor over the period from January 1976 to October 1980, plaintiff said:
Had I known that there would be several law suits filed against me as Executor and of the extensive managment [sic] and various problems which I would encounter in the furtherance of this estate I would not have accepted said office for $20,000.00 and in fact in becoming Executor of said estate I understood that I would be compensated additionally to the $20,000.00 for any work, labor, or managment [sic] which I did in excess of $20,000.00 spoken of in SAMUEL W. BERREY'S Will.
All of the labor, managment, [sic] investments and support which I have performed for said estate was done with the approval of the sole beneficiaries, who are Defendants herein and they accepted the fruits of my labor but as I understand do not wish to pay me for the gains which I made for said estate.
This is the factual position taken by plaintiff to support his claim of mutual mistake in his acceptance of the office of executor.
A mutual mistake is "one common to both or all parties, wherein each labors under the same misconception respecting a material fact, the terms of the agreement, or the provision of a written instrument designed to embody such an agreement." Capitol Rod & Gun Club v. Lower Colorado River Authority, 622 S.W.2d 887, 892 (Tex. Civ.App.-Austin 1981, writ ref'd n.r.e.). It is also described as one common to both parties to a contract, each laboring under the same misconception. Schmaltz v. Walder, 566 S.W.2d 81 (Tex.Civ.App.-Corpus Christi 1978, writ ref'd n.r.e.). In order for the defense of mutual mistake to be sustained, there must be fact issues raised to *554 show that both parties to a contract were acting under the same understanding of the same material fact. Newsom v. Starkey, 541 S.W.2d 468 (Tex.Civ.App.-Dallas 1976, writ ref'd n.r.e.). A unilateral mistake will not provide a basis for reformation of an instrument. Capitol Rod & Gun Club v. Lower Colorado River Authority, supra.
Applying these rules to this case we must hold that plaintiff cannot as a matter of law raise a material fact issue regarding mutual mistake. Samuel Berrey, in drafting Paragraph V of his will, in the words of the Stanley court, "used language as plain as can be used" that plaintiff should receive $20,000.00 for his services as executor of Berrey's estate. Plaintiff's affidavit did not raise a question of mutual mistake but expresses only disappointment in retrospection. The language of Paragraph V of the will is not ambiguous, and testimony would not be allowed on trial to vary its content. Furthermore, appellant would be prevented by the Deadman's Statute, Tex. Rev.Civ.Stat.Ann. art. 3716 (Vernon 1969) from testifying about any transaction or conversation with the decedent. Point of error number two is overruled.
Plaintiff's third point of error attacks the granting of the summary judgment, claiming it is contrary to the purpose of Tex.R.Civ.P. 166A, and that it deprives him of the determination of genuine issues of material fact. We recognize that in order for defendants to prevail, they had the burden to show that the cause of action was barred by some legal barrier. Kolb v. Texas Employers' Insurance Association, 585 S.W.2d 870 (Tex.Civ.App.-Texarkana 1979, writ ref'd n.r.e.). Defendants assumed the burden to show that as a matter of law plaintiff has no cause of action against them. Citizens First National Bank of Tyler v. Cinco Exploration Co., 540 S.W.2d 292 (Tex.1976). The function of a summary judgment is not to deprive a litigant of trial by jury, but to eliminate patently unmeritorious claims and untenable defenses. Gulbenkian v. Penn, 151 Tex. 412, 252 S.W.2d 929 (1952); Happy Cattle Feeders, Inc. v. First National Bank, 618 S.W.2d 424 (Tex. Civ.App.-Amarillo 1981, no writ). The operation of a motion for summary judgment, such as the one here filed which challenges the sufficiency of plaintiff's pleadings to raise a genuine issue of fact which would constitute a cause of action, is closely analogous to a special exception challenging the sufficiency of a non-movant's pleading as a matter of law. Billstrom v. Memorial Medical Center, 598 S.W.2d 642 (Tex.Civ.App.-Corpus Christi 1980, no writ). Plaintiff's petition is entitled to the benefit of every reasonable inference which can be properly drawn in its favor. Billstrom v. Memorial Medical Center, supra; Martin v. Trevino, 578 S.W.2d 763 (Tex.Civ.App.-Corpus Christi 1978, writ ref'd n.r.e.).
We view the summary judgment evidence, as we must, favorably to plaintiff. We assume for purposes of this motion for summary judgment that plaintiff did an exemplary job as independent executor, that he conserved all assets of the estate, that by his management he increased the value of the estate, all to the benefit of defendants. We find for purposes of the motion for summary judgment that plaintiff believed that he would be paid more than $20,000.00 for his services and that the value of his services exceeded $20,000.00. We have already found, however, that as a matter of law, plaintiff could not recover more than $20,000.00 on the ground of unjust enrichment or quantum meruit, because by accepting the office of executor, he entered into performance of an express contract. The two equitable theories of recovery, unjust enrichment and quantum meruit, rest in implied contract, and as such, they are inconsistent with recovery under express contract. We have also found as a matter of law that plaintiff has no cause of action based on mutual mistake. We note that the cases of Capitol Rod & Gun Club v. Lower Colorado River Authority, supra, and Schmaltz v. Walder, supra, were summary judgment cases. We have held that the assertions made by plaintiff as to his understanding are not facts which would establish mutual mistake. Sharpe v. Lomas & Nettleton Financial Corp., 601 *555 S.W.2d 55 (Tex.Civ.App.-Dallas 1980, writ ref'd n.r.e.). For all of these reasons we hold that defendants proved that there is no genuine issue of material fact and we overrule plaintiff's third point of error.
The judgment is affirmed.
