OPINION OF THE COURT
WEIS, Circuit Judge.A subcontractor on an apartment building project and the trustee in bankruptcy for the owner each claim the right to undisbursed construction mortgage funds in the hands of a bank. Discerning no contract between the subcontractor and the bank or the owner, the district court entered judgment for the trustee. We conclude that, under Pennsylvania law, the subcontractor is entitled to recover on third party beneficiary, equitable assignment, or unjust enrichment theories and accordingly reverse.
I
Gebco Investment Corporation entered into an agreement with its wholly owned subsidiary, Lion Development and Construction Corporation, to build an apartment house near Pittsburgh, Pennsylvania. Financing for the project was provided by Equibank, which loaned $85,000 secured by a mortgage executed in February 1974. To satisfy one condition of the loan, Gebco and Lion agreed that no liens would be filed by any subcontractors. Pursuant to Pennsylvania law, this no-lien contract was duly recorded in the Prothonotary’s Office of Allegheny County, Pennsylvania.
*145As part of the transaction with Equibank, Gebco signed a construction loan agreement providing that the bank would advance monies in stages as the building progressed. According to the payment schedule incorporated in the agreement, Gebco and Lion would certify monthly the work completed and costs incurred. The bank would then advance 90% of the requested amount, reserving the right to hold the remainder in escrow to satisfy any outstanding indebtedness associated with the construction. The agreement contained a provision reciting, “Lender will ... lend .. . the sum of $85,-000. 00 to be used only for the payment of labor and material costs in the construction of the Improvements . . . .” The following paragraph of the agreement states, “All monies borrowed or advanced ... will be applied entirely and exclusively for the payment of the labor and materials used in the construction . . . .” The contract documents also required that before disbursement of the final installment, Gebco was to produce “[p]roperly executed Release of Liens evidencing payment for all labor done and materials delivered in connection with the proposed Improvements.” The bank was given the option of advancing the sums directly to subcontractors.
Construction began on the following month and in April 1975 the appellant, Monroeville Electric Co., Inc.,1 began performance of its subcontract to install the electrical equipment in the building. During the autumn of that year, various subcontractors, including Monroeville Electric, encountered delays in payment and were referred by Gebco to the bank. Although bank officials did not guarantee payment of the subcontractors’ bills, they stated that sums adequate to compensate the subcontractors were being held and would be disbursed when the project was completed. Even though no independent agreements were undertaken by the bank, the subcontractors returned and completed their work.
Apparently in November 1975, after Equibank had advanced a total of $59,580, the bank held Gebco in default.2 Nevertheless, it was after that date that some of the subcontractors continued to work on the apartment building. Invoking the terms of the construction loan agreement, the bank refused to advance further funds to Gebco, and retained $25,420.
In February 1977 Gebco filed a Chapter X petition for reorganization, and in September of that year, pursuant to an order of the bankruptcy court, the trustee sold the completed apartment building for $120,-000. The mortgage was paid in full, and in the following month the trustee brought suit against the bank to recover the $25,420 of undisbursed funds. The bank disclaimed any interest in the money and invoked Bankruptcy Rule 7193 to join a number of subcontractors, including Monroeville Electric, as parties to the litigation.
The bankruptcy judge held that under § 70(a) of the Bankruptcy Act, 11 U.S.C. § 110 (1976), the trustee succeeded to Gebco’s right under the construction loan agreement to collect sums due from the escrow fund held by the bank. The judge concluded that the subcontractors’ claims failed because Equibank had no legal obligation under the terms of the loan agreement to pay the money to the subcontractors. Although the agreement gave Equibank the right to protect the security position of its mortgage by paying subcontractors directly, the bank had not exercised its prerogative. Nor did Equibank enter into separate agreements with the subcontractors or induce them to complete their work. The bank, therefore, was directed to turn over the money to the trustee.
*146The subcontractors appealed the decision to the district court, which affirmed without opinion. Only one subcontractor, Monroeville Electric, has appealed to this court.
II
It is important at the outset to clarify the positions of the parties to this litigation. Equibank concedes that it is not entitled to the money but is merely a stakeholder. The dispute, then, is between the trustee, standing in the shoes of the owner Gebco, and the subcontractor. When asserting a right of action against another in circumstances such as those present in this case, the trustee has no greater rights than the bankrupt had. Mutual Life Trust Insurance Co. v. Wemyss, 309 F.Supp. 1221, 1231 (D.Me.1970); 4A Collier on Bankruptcy 170.28, at 385 (14th ed. 1978). Furthermore, “any defense, legal or equitable, which might have been raised against the bankrupt may be raised against the trustee.” Id.; see In re Jacoby, 138 F.2d 42, 45 (3d Cir. 1943).
A
In claiming entitlement to the fund, the trustee contends on appeal that the bank did not create the fund for the benefit of the subcontractors but merely suspended payment to Gebco when it defaulted. Further, says the trustee, the $25,420 fund was not created until after the sale had taken place and Equibank’s mortgage of $85,000 was satisfied in full.
Pennsylvania law concededly is applicable here. The trustee asserts that some guidance and support for his position may be found in Demharter v. First Federal Savings & Loan Association, 412 Pa. 142, 194 A.2d 214 (1963), but we believe that case is inapposite. There, subcontractors claimed that the bank had been under an equitable obligation to pay construction money directly to the subcontractors as the work progressed rather than to the owner. They objected to the fact that the bank had continued to advance funds to the owner after being notified by some of the subcontractors that they were owed substantial amounts by the owner. Arguing that the bank had no authority under the loan agreement to disburse funds to the owner, the subcontractors asked for damages from the bank in an amount equal to that given to the owner. The court, however, found in favor of the bank since it was not obligated under the loan agreement to pay material-men.
The relationship between the bank and the subcontractors here is different. Monroeville Electric is not challenging the propriety of the advances Equibank actually made to Gebco before it was held in default. Rather, Monroeville Electric is asserting rights to an unreleased amount of money earmarked for the benefit of subcontractors. Monroeville Electric’s interest in that fund is not affected by Demharter’s holding that the loan agreement justified the bank’s payments to the owner before default.
Closer to the facts of the case at hand is Kreimer v. Second Federal Savings and Loan Association, 196 Pa.Super. 644, 176 A.2d 132 (1961), where a materialman sought to recover from a fund held by the lender. There was a no-lien contract in that case and the construction loan agreement contained a provision that the bank would pay “directly to those furnishing labor” and materials. The Pennsylvania Superior Court held that a subcontractor, rather than the bankrupt general contractor, was entitled to the funds in the possession of the mortgagee bank. The court said that the subcontractor had a direct interest as a third party beneficiary and the bankrupt’s interest was restricted to that portion of the fund remaining after the subcontractor’s obligation was satisfied.
Because Equibank was not obligated to pay directly to subcontractors, the case for application of a third party beneficiary status is not as obvious as it was in Kreimer. Nevertheless, as we will show, there is ample basis for concluding that the parties to the loan agreement understood that a fund would come into existence and intended it to be for the benefit of the subcontractors.
*147The trustee contends on appeal that the fund was created only after all work was completed and the property sold, but that argument is not persuasive. It cannot be reconciled with the testimony of Gebco’s own general manager, Robert E. Barrett, before the bankruptcy judge. Barrett maintained that it was his understanding from conversations with bank officials that all the money would be paid out when the construction was completed. A bank official also testified he had told the owner of Monroeville Electric that after “the building was completed ... there would be distribution of the funds that were remaining.” It was the common understanding of the parties to the loan agreement, then, that the fund existed before the sale of the property.
The terms of the construction loan agreement quoted above make it clear that the proceeds were to be used for a specific purpose — payment of subcontractors and materialmen on the project. In fact, the amount of each advance was determined by the actual cost of labor and materials. Under the provisions of the agreement, the loan was not to be used to pay for costs other than these. That Gebco understood this to be the intent of the agreement is established by the explanation of its general manager at the bankruptcy hearing. Barrett testified that the money remaining in the fund “was earmarked as far as Gebco was concerned” for the payment of the subcontractors.
An arrangement such as this was certainly not inequitable given that Gebco had taken the appropriate steps to deny the subcontractors their right to file mechanic’s liens. The fact that subcontractors were not expressly named as third party beneficiaries is not determinative since the intent of the parties is clear from the language of the agreement taken as a whole. See Commonwealth v. Great American Indemnity Co., 312 Pa. 183, 167 A. 793 (1933); cf. Gee v. Eberle,-Pa.Super.-, 420 A.2d 1050, 1055-56 n.4 (1980) (express provision of agreement disclaimed intent to create third party beneficiary); R. M. Shoemaker v. Southeastern Pennsylvania Economic Development Corp., - Pa.Super. -, 419 A .2d 60, 63 (1980) (same).
The record demonstrates, therefore, that the parties to the agreement understood that the subcontractors were third party beneficiaries of the undisbursed funds. Spires v. Hanover Fire Insurance Co., 364 Pa. 52, 56-57, 70 A.2d 828, 830 (1950). Our agreement with the bankruptcy judge that the evidence did not establish a separate contract for Monroeville to complete its work for the account of the bank is thus not determinative. Rather it is significant that he found that the bank informed subcontractors that “it would pay the money over to Gebco in accordance with the construction loan agreement.” This determination was supported by testimony that confirmed the understanding of Gebco and the bank and brought home to the subcontractor, if it was not already aware of it, that a fund was being held for its benefit.
B
Even if the parties to the loan transaction had not clearly intended to benefit a third party, Monroeville Electric contends that it should recover as an equitable assignee under the terms of the loan agreement. See Warrington v. Mengel, 41 Pa.Super. 362 (1909). The subcontractor relies on the fact that the loan agreement not only required Gebco to secure a no-lien stipulation from its general contractor, but also required Gebco, before the final payment was made, to produce a release of liens “evidencing payment for all labor done and materials provided.” Although this provision was in the main to benefit the bank by enabling it to protect the priority of its mortgage, Monroeville Electric argues that the clause also constitutes an undertaking by the owner to see that all subcontractors were paid.
At the time the work was completed, Gebco could not have produced a release of liens because of the outstanding balances due the subcontractor Monroeville Electric. We are not unmindful of the fact that the no-lien contract prevented the subcontractor from perfecting a valid mechanic’s lien, *148but the requirement of a release substantially benefited Monroeville Electric. The subcontractor could assume that the bank would not disburse the funds without being assured the materialmen had been paid. But see B. Bornstein & Son, Inc. v. R. H. Macy & Co., -Pa.Super. -, 420 A.2d 477 (1980).
By undertaking to provide a release of liens, Gebco assumed an implied obligation to the subcontractors. The provision was written at the insistence of the bank for its benefit, and as a practical matter, it is unlikely that the loan would have been granted without that condition. Thus in return for assuming this obligation, Gebco received substantial consideration in the form of a loan. The trustee, standing in Gebco’s shoes, is in no position to repudiate the equitable obligation undertaken at the time the loan was negotiated. The fact that the mortgage was later paid does not release the equitable charge attached to the funds in the bank’s hands. That fund was encumbered in favor of the subcontractor who had a superior right to it over the owner or its trustee.
In Warrington v. Mengel, supra, the court held that a similar arrangement constituted an equitable assignment. The work having been completed, the court said the implied obligation of the defendants “arising out of the terms and conditions upon which they held the money, in which they allege they had no personal interest, therefore became operative and they are bound thereby.” Id. at 366. In a case analogous to the one at hand, the Court of Common Pleas of Allegheny County in All-State Industries, Inc. v. H. E. Stoudt & Sons, Inc., 126 Pitt.Legal J. 293, 9 Pa. D. & C.3d 552 (1978), held that an escrow fund was held by a bank for the benefit of subcontractors. Similarly, we conclude that an equitable charge was placed upon the mortgage funds in the hands of the bank in favor of the subcontractor Monroeville Electric which has a superior right to the money over that of the trustee.
C
As an additional theory of recovery, Monroeville Electric maintains that Equibank and Gebco should not profit at the subcontractor’s expense. In a recent opinion, the Pennsylvania Superior Court held that a constructive trust may be imposed to avoid unjust enrichment in similar circumstances. Gee v. Eberle, supra.
In Gee, the original owner and lender had entered into a construction loan agreement similar to the one between Gebco and Equibank: advances were made periodically to cover 90% of the cost of labor and materials to date. The lender could, but was not obligated to, make payments directly to the subcontractors. The lender foreclosed before all the funds were advanced, had the project completed, and then purchased the property at a sheriff’s sale. The subcontractors sought to recover from the unexpended loan fund.
The court found that the lender in Gee had gained the benefit of possession of the property improved through the subcontractors’ efforts. Because the subcontractors had not been compensated, however, the court concluded that the lender could not, “in good conscience retain the beneficial interest” it had acquired. Id. at-, 420 A.2d at 1056, quoting Buchanan v. Brentwood Federal Savings & Loan Association, 457 Pa. 135, 151, 320 A.2d 117, 126 (1974). Under those circumstances, the court held that the lender had been unjustly enriched.
In this case Equibank received a benefit when the entire mortgage was satisfied even though some funds were undisbursed. Had the owner not defaulted and the remainder of the fund been paid out, the subcontractors would have been compensated. As it was, however, the subcontractors were not paid and their efforts increased the value of the mortgaged property. It was on the sale of that improved property that Equibank received its benefit.
Gebco has also been enriched by the sale. The building had been estimated to cost approximately $86,000, but sold for $120,-000. The profit on the sale would, of course, be enjoyed by Gebco’s creditors. If *149that profit is increased by Gebeo’s failure to pay subcontractors who improved the property, however, the incremental benefit would constitute unjust enrichment.
The trustee on behalf of Gebco has not demonstrated a superior right to the fund over that of the subcontractor, but rather is in a less favorable position since Gebco’s recovery would result in unjust enrichment. To avoid such a result, a constructive trust for the benefit of the subcontractor should be imposed on the fund in Equibank’s possession. Gee v. Eberle, supra.
We conclude that Monroeville Electric could recover from the fund held by Equibank either as a third party beneficiary of the construction loan agreement, as an equitable assignee, or in order to avoid unjust enrichment to the bank or Gebco.
Accordingly, the judgment of the district court will be reversed and the ease remanded for proceedings consistent with this opinion.
. Throughout the bankruptcy proceeding, the appellant has been referred to as Monroeville Electronics Company. That name has been retained in the caption, but in the text the appellant will be referred to by its proper name, Monroeville Electric Co., Inc.
. The record is not clear as to when this event occurred, and the briefs are not informative.
. This case arose before the effective date of the Bankruptcy Code, 11 U.S.C. §§ 101-151326 (Supp. Ill 1979). Thus, its predecessor, the Bankruptcy Act, 11 U.S.C. §§ 1-1103 (1976), applies. We will therefore refer to the Act and its applicable rules in the present tense.