
645 A.2d 1142 (1994)
ALADDIN ELECTRIC ASSOCIATES
v.
TOWN OF OLD ORCHARD BEACH.
Supreme Judicial Court of Maine.
Submitted on Briefs June 20, 1994.
Decided August 19, 1994.
*1143 Paul S. Bulger, Richardson & Troubh, Portland, for plaintiff.
David R. Ordway, Ordway & Associates, Biddeford, for defendant.
Before WATHEN, C.J., and ROBERTS, GLASSMAN, CLIFFORD, RUDMAN, and LIPEZ, JJ.
WATHEN, Chief Justice.
Plaintiff Aladdin Electric Associates ("Aladdin") appeals from a judgment of the Superior Court (York County, Cole, J.) finding in its favor on a claim for unjust enrichment and awarding damages. Aladdin argues that the court's award of damages is insufficient as a matter of law. Defendant Town of Old Orchard Beach cross-appeals, arguing that Aladdin's equitable claim is barred by its failure to pursue a remedy at law and that the Town's retention of any benefit conferred by Aladdin is not unjust.
The facts of this case are nearly identical to those in A.F.A.B., Inc. v. Town of Old Orchard Beach, 639 A.2d 103 (Me.1994) [hereinafter AFAB II] and A.F.A.B., Inc. v. Town of Old Orchard Beach, 610 A.2d 747 (Me.1992) [hereinafter AFAB I]. As in those cases, the plaintiff here, Aladdin, was a contractor that performed work in renovating the Ballpark in Old Orchard Beach in 1988. At the time, the Town owned the Ballpark and was negotiating to sell it to Stadium Partners, Inc. ("Stadium"). Stadium contracted with Aladdin to do electrical repairs at the Ballpark. Stadium told Aladdin that if the Ballpark purchase did not take place, Aladdin would still get paid by the Town under a clause in the purchase and sale agreement. After the work was completed, the sale fell through, and Aladdin was not fully paid by Stadium. Aladdin initially filed a mechanics lien against the Ballpark, but did not perfect that lien. Aladdin's president, Joseph Madjerac, testified that Aladdin did not perfect the lien after receiving a copy of paragraph 18 of the purchase and sale agreement, which states:
18. Repairs and Improvements Prior to Time of Closing. Seller [the Town] and Buyer [Stadium] agree to cooperate with [the Maine Phillies] to determine the repairs and improvements to The Ballpark necessary for the use and occupation thereof by the Maine Phillies on or prior to April 10, 1988. Buyer may, in its sole and complete discretion, agree to make and pay for some or all such repairs and improvements prior to the Time of Closing. In the event this Agreement does not close for any reason other than default by the Buyer, Seller will, upon termination of the Agreement, reimburse Buyer for the cost of all such repairs and improvements made by the Buyer.

(Emphasis added). The Town Manager, Jerome Plante, testified that the Ballpark was unusable before the renovations, and that the Town would have had to make the repairs anyway in order to rent the Ballpark. After renovations, the Town did rent the Ballpark for an amount sufficient to cover its debt service.
Madjerac testified that Aladdin's cost of materials was $14,841.01, and that the cost was typically marked up before billing a customer. *1144 He also testified that the electricians who worked for Aladdin at the Ballpark were paid $9 to $10 per hour, but that the workers cost Aladdin approximately $22 per hour, including Aladdin's payroll costs and overhead but not profit. Aladdin sought to recover $26,349.26, the amount billed to Stadium for its work, less payments already made by Stadium. The contract between Stadium and Aladdin called for total payments of $41,349.26 for the work performed.
The court found that the Town had been unjustly enriched, but awarded only $5,791.01, an amount representing the "benefit of the work and materials provided by Plaintiff" (determined by multiplying the number of hours worked, 595, by $10 per hour, and adding $14,841.01 for materials) for a total of $20,791.01, minus the payments already made by Stadium, $15,000.00.
The Town argues that the court had no jurisdiction over this equitable claim because Aladdin failed to pursue its legal remedy of a mechanics lien. As we previously stated in AFAB I:
Lack of privity of contract and failure to perfect a lien do not bar an action for unjust enrichment. Pendleton v. Sard, 297 A.2d 889, 894 (Me.1972).... Such actions are only barred where the property owner has paid the general contractor in full or when the owner had no reason to believe that it would be liable for the costs incurred. Id. at 895.
AFAB I, 610 A.2d at 749. It is undisputed that Aladdin has not been paid in full for its work, and the Town admitted that "under certain circumstances, [it] would be liable for payment of work performed by Aladdin Electric Associates in connection with the ballpark." The Superior Court properly exercised jurisdiction over this equitable claim.
To establish a claim for unjust enrichment, three elements must be proven:
[One] a benefit conferred upon the defendant by the plaintiff; [two] an appreciation or knowledge by the defendant of the benefit; and [three] the acceptance or retention by the defendant of the benefit under such circumstances as to make it inequitable for the defendant to retain the benefit without payment of its value.
AFAB I, 610 A.2d at 749 (quoting Estate of White, 521 A.2d 1180, 1183 (Me.1987)). The trial court's conclusions on these elements are factual findings which will not be set aside as clearly erroneous unless there is no competent evidence in the record to support them. White, 521 A.2d at 1183. The first two elements are supported by the record and uncontested by the Town on appeal.
The Town argues that the Superior Court incorrectly found the third prong satisfied, and that it is not inequitable for the Town to retain the benefits conferred by Aladdin. All the relevant facts and circumstances of the case should be considered in making this determination. AFAB II, 639 A.2d at 106 n. 4. There is evidence in the record supporting the Superior Court's conclusion that the Town's retention of benefits in this situation is unjust. The Town was not required to and did not pay Stadium for the work at the Ballpark; Aladdin has been unable to contact Stadium regarding further payment for its work; because the work was done on a rush basis there may not have been time for Aladdin to perform a credit check; and the Town was on notice that subcontractors could look to it for payment. See Pendleton v. Sard, 297 A.2d 889, 895 (Me.1972). The Town here was acting in a proprietary rather than governmental role. See AFAB II, 639 A.2d at 106 n. 4. Finally, although there is an interest in protecting taxpayers, see id. at 106, the work benefitted the Town by allowing it to rent the Ballpark, thereby covering payments due on the property, which it could not have done but for the subcontractors' work. The Superior Court's factual finding that the Town's retention of benefits, without payment to Aladdin, would be unjust is not clearly erroneous.
Aladdin argues that the court awarded insufficient damages by failing to account for its true labor costs and a reasonable profit. The Town contends that, if damages are required, the award is sufficient. The court received evidence of the cost of materials, the amount paid to Aladdin's workers, the total cost to Aladdin for each hour put in by its workers (including overhead and other expenses), *1145 and the practices of Aladdin and of the industry in marking up materials and labor. The damage award, however, refers only to the cost of materials and the amount paid to each worker, despite undisputed testimony that Aladdin's overhead expenses and profit were higher than the amount awarded in damages. Moreover, in making its damages determination the court appeared to equate the cost of materials and the amount paid to each worker with the enhanced value of the property owned by the Town: "I find that the benefit of the work and materials provided by Plaintiff for the benefit of the Town of Old Orchard Beach is $20,791.01 with a credit for the $15,000.00 already paid by Defendant Stadium Partners, Inc."
There are three problems with this approach to damages. First, the cost of improvements alone does not necessarily determine enhanced value. As we stated in AFAB I, "the cost of the improvements is evidence of the enhanced value." See AFAB I, 610 A.2d at 750 (emphasis added). The second problem relates to the components of the damages award:
[T]he court's determination of damages of [$20,791.01] appears to be based solely on the cost of improvements. The court appears to have categorically excluded from consideration ... [Aladdin's] overhead expenses and profit. Such a blanket exclusion of a plaintiff's overhead, costs, and profits is improper unless the court determines that they have no meaningful relationship to the value of the benefit conferred and the extent to which a defendant has been [unjustly] enriched.
See AFAB II, 639 A.2d at 106 (emphasis in original). The third problem relates to the deduction of $15,000, the amount paid to Aladdin by Stadium, from the court's determination of the benefit to the Town of $20,791.01. The $15,000 paid by Stadium to Aladdin pursuant to a contract between those parties relates to the reasonable value of the work and material provided by the contractor  the issue in a quantum meruit case. In an unjust enrichment case, the inquiry focuses on the benefit realized and retained by the defendant as a result of the improvements provided by the contractor. Deducting the payment to the contractor for work and materials provided ($15,000) from the value of the benefit conferred on the Town by the improvements ($20,791.01) confuses the concepts of quantum meruit and unjust enrichment.
As we stated in AFAB II, the distinction between "unjust enrichment" and "quantum meruit" is legally significant. Quantum meruit involves recovery for services or materials provided under an implied contract. "Unjust enrichment describes recovery for the value 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." AFAB II, 639 A.2d 103, 105 n. 3 (Me.1994). In an unjust enrichment case the court must decide what constitutes the inequitable retention of a benefit by the defendant. The damages analysis is based on principles of equity, not contract.
By equating Aladdin's cost of improvements with enhanced value to the Town, and by excluding from the cost of improvements overhead and profits, the court has essentially found that the work performed by Aladdin on the Ballpark pursuant to a $41,349.28 contract with Stadium conferred a benefit on the Town of only $20,791.01. Although the court may have intended such a finding, that dramatic disparity between the contract price and the benefit conferred on the Town would require an explicit finding of such a disparity and the reason for it. In light of the court's deduction of $15,000 from the damages determination of $20,791.01, a deduction more appropriate to a quantum meruit claim than a claim for unjust enrichment, we are convinced that the court was incorrectly applying principles of quantum meruit to an unjust enrichment claim, and hence the damage award must be vacated.
In the present case, plaintiff should be awarded the full amount of the benefits that would otherwise be unjustly retained by the Town as a result of plaintiff's work unless *1146 that would result in receipt of more than the plaintiff was contractually entitled to receive as a result of its contract with Stadium. We add that important caveat because the equitable concept of unjust enrichment would not justify an award to plaintiff in excess of what it was contractually entitled to received from Stadium.
The entry is:
Judgment vacated. Remanded for further proceedings consistent with the opinion herein.
All concurring.
