This case, which is(before us on affidavit of defense in the nature of a demurrer, involves the right of a third party beneficiary to sue upon a contract. The Great American Indemnity Company, the defendant, is the surety on a bond given to the Commonwealth of Pennsylvania by the Nelson-Pedley Construction Company to guarantee the faithful performance of a contract between it and the Commonwealth for the erection of South Office Building No. 2, in Capitol Park, Harrisburg, Pennsylvania. The plaintiff, which was a subcontractor on the work, has brought this suit on the bond in its own name to recover the amount of an unpaid claim against the principal in the bond- for labor and materials furnished to the work. One of the conditions of the bond was that the Nelson-Pedley Construction Company, the general contractor, would “pay all lawful claims of subcontractors, materialmen and laborers for labor performed and materials furnished in the carrying forward, performing or completing” the work.
Under the foregoing facts, disclosed by the plaintiff’s statement, the defendant contends, first, that the Act of April 22, 1903, P. L. 255, under which'the bond appears to have been given, and which requires approved surety for the protection of laborers and materialmen to be given by all contractors for public work, is unconstitutional; and, second, that, even if the act were constitutional, the language of the bond in suit neither expressly, nor, under the established rules for the interpretation of such instruments, impliedly confers on third parties the right to sue upon it.
*226In support of the first of these contentions, the defendant relies upon the case of Smith’s Appeal, 241 Pa. 336, as holding the entire Act of 1903 in violation of article in, section seven, of the Constitution, which prohibits local or special legislation providing or changing methods for the collection of debts. It is true that the case cited does hold the Act of 1903 unconstitutional in this respect. We cannot agree, however, that the decision in Smith’s Appeal determines the unconstitutionality of that act in its entirety, since the constitutional question there presented and decided involved only the procedural part of the act. It is well established that, if one provision of an act is found to be unconstitutional, the remaining provisions are not thereby invalidated, unless the unconstitutional provision is so interwoven with the others that the latter are inoperable independently of the one invalidated, and the general scheme of the legislation is destroyed: 36 Cyc. 976; Bagley Co. v. Cameron, 282 Pa. 84. Applying this principle to the Act of 1903, we see no such interdependence between its unconstitutional procedural provisions and its requirement that security shall be entered by contractors on public works as to render the latter and principal purpose of the act unconstitutional. The act amends section six of the Mechanics’ Lien Law of June 4, 1901, P. L. 431, and provides as follows: “Section 6. Where labor or materials are furnished for any structure or other improvement for purely public purposes, in lieu of the lien given by the act, any sub-contractor who has furnished labor or materials thereto may give a written and duly sworn notice to the Commonwealth, or any division or sub-division thereof, or any purely public agency thereunder, being the owner of the structure or other improvement, setting forth the facts which would have entitled him to a lien as against the structure or other improvement of a private owner; whereupon, unless such claim be paid by the contractor, or adequate security be given or have been given to protect all such claimants, the Commonwealth or the division or sub-division thereof, or purely public agency thereunder, shall pay the balance actually due the contractor into the court of common pleas of the county in which the structure or other improvement, or the principal part thereof, is situate, for distribution to such parties as would be entitled thereto were it paid into court in the case of a private owner; and the Commonwealth hereby does, and any division or sub-division thereof, or any purely public agency thereunder, may, require that any contract for public work shall, as a condition precedent to its award, provide for approved security to be entered by the contractor to protect all such parties. If a dispute arises as to the balance actually due, the amount admitted shall be paid into court, and a suit brought to recover the disputed part, in the name of the contractor to the use of the parties interested, and any amount recovered shall be distributed as above set forth.”
The reason for the inclusion of section six in the Mechanics’ Lien Law, to which the Act of 1903 is an amendment, is evident. Since liens could not be filed against public property held for purely public purposes, some measure of effective protection had to be devised for subcontractors on public works, who could not resort to the mechanic’s lien. The legislature, therefore, supplied that protection in section six, first, by requiring all contracts for public work to provide for approved security to be entered by the contractor “to protect” subcontractors; and, second, by providing as a purely alternative and independent remedy, arising only in the event of the failure of a contractor to give the required security, that if the claim of the subcontractor is not paid by the contractor or adequate security “be given or have been given to protect” him, the Commonwealth should, on receipt of notice of an unpaid *227claim of a subcontractor, pay the balance actually due the contractor into court “for distribution to such parties as would be entitled thereto were it paid into court in the case of a private owner.” In Smith’s Appeal, the constitutionality of the alternative procedure provided by the act was the only question before the Supreme Court. The Commonwealth had paid the money due the general contractor into court as provided by the act. On distribution, it was awarded to the subcontractor against the protest of the general contractor’s personal representative, and the latter appealed from the award. The opinion of the Supreme Court deals exclusively with the constitutionality of the act as special legislation creating a new method for collecting debts, and holds the act unconstitutional in that respect. This was the only question before the Supreme Court, which neither had before it, nor pretended to deal with, the validity of that part of the act which requires contractors on public works to give security for the protection of subcontractors. This form of protection is neither new nor unusual in contracts for public work. The Commonwealth and all governmental agencies are constantly exacting it. It is found in the provisions of numerous acts of assembly regulating the letting of public contracts, and the right of the Commonwealth to protect subcontractors in this manner has been repeatedly upheld: Greene County v. Southern Surety Co., 292 Pa. 304; Philadelphia v. Stewart, 195 Pa. 309. Such protection does not involve questions of remedies or methods of collecting debts. It relates to substantive and not remedial law; and could not fall within the ban of the constitutional prohibition under consideration in Smith’s Appeal.
That being so, it remains only to consider whether that part of the Act of 1903 which was held unconstitutional in Smith’s Appeal is so inextricably linked with the part requiring security to be given by contractors as to invalidate the latter. While it is true that, in the act itself, the procedure which was held unconstitutional precedes the requirement for the giving of bonds by contractors, it is manifest that the former is only subordinate and alternative to the latter. The principal purpose of the act is to protect subcontractors by requiring all general contractors to furnish security for the payment of claims against them, for the alternative procedure comes into operation only when the bond required is not given. We quote from the act: “Where labor or materials are furnished ... in lieu of the lien given by this act, any sub-contractor . . . may give a written and duly sworn notice to the Commonwealth . . . setting forth the facts which would have entitled him to a lien . . . whereupon, unless such claim be paid by the contractor, or adequate security be given or have been given to protect all such claimants, the Commonwealth . . . shall pay the balance actually due the contractor into the court . . . for distribution to such parties as would be entitled thereto . . . and the Commonwealth hereby does, and any division or sub-division thereof . . . may, require that any contract for public work shall, as a condition precedent to its award, provide for approved security to be entered by. the contractor to protect all such parties. . . .” The purely alternative and subordinate character of the first part of this act will become apparent if we invert its provisions and put the principal one where it naturally belongs. Doing this and condensing the quotation for convenience, it reads: “The Commonwealth hereby does . . . require that any contract for public work shall . . . provide for approved security to be entered by the contractor to protect all such parties [sub-contractors]. Where labor and materials are furnished . . . any sub-contractor . . . may give . . . notice to the Commonwealth . . . setting forth the facts . . . whereupon, unless such claim be paid ... or adequate security be given or have been given to protect all such *228claimants the Commonwealth . . . shall pay the balance actually due the contractor into the court . . . for distribution to such parties as would be entitled thereto,” etc. Reading the act thus, the exaction of a bond for the projection of subcontractors is seen to be the primary purpose of the legislation. The provision as to the bond also is seen to be complete and self-sustaining, and the striking down of the alternative procedural provisions in no way destroys the former’s unity and completeness. A bond given under this act creates a contractual obligation which is enforceable by the usual method for the enforcement of contractual rights. We are, therefore, of opinion that the Act of 1903 is constitutional in so far as it requires all contracts for public work, as a condition precedent to their award, to provide for approved security to be entered by the contractors to protect all subcontractors.
This brings us to the second question raised by the affidavit of defense filed by the defendant: whether the condition of the bond, that the general contractor would “pay all lawful claims of subcontractors, materialmen and laborers for labor performed and materials furnished in carrying forward, performing or completing” the work, brings the bond within the provisions of the Act of 1903, so that this plaintiff, as a third party beneficiary, may sue upon it in its own name. The underlying rule to be gathered from all the authorities for determining the right of third persons beneficiary to sue upon a contract is whether it was the intention of the parties that the third person was to be primarily benefited by the contract; that is to say, whether its purpose was primarily to benefit the third person or the contracting parties. In cases where the contract expressly confers upon third parties the right to sue, or where the intention to confer such a right, though not expressed, is clearly disclosed by the language used, the problem is simple. Where, however, the language used does not clearly disclose the intention of the contracting parties, considerable difficulty may be encountered in determining whether such intention exists. The seeming confusion and apparent inconsistencies resulting from the many decisions upon this question to be found in the authorities are due, not to any uncertainty in the underlying principle controlling the decisions, but rather to variations in the language used, and the circumstances attendant upon the many contracts which have been subjected to judicial scrutiny. In Greene County v. Southern Surety Co., 292 Pa. 304, Mr. Justice Kephart reviewed authorities preceding that decision, and pointed out general lines of reasoning by which one result or the other was reached in each case. It is settled beyond question that at common law a third party cannot sue upon a contract under seal, unless the contract explicitly confers that right upon the third party, or it falls within certain well-defined exceptions. These exceptions are summarized in First Methodist Episcopal Church v. Isenberg, 246 Pa. 221, 224, as follows: “To the rule of the common law that no one can maintain an action in his own name upon a contract to which he is not a party, there are well-settled exceptions, which are enforced whenever the facts of the case require it: Howes v. Scott, 224 Pa. 7. These exceptions are where one person agrees with another to pay money to a third, or to deliver some valuable thing, and such third party is the only one interested in the payment or delivery; or where the promise to pay the debt of a third person rests upon the fact that money or property is placed in the hands of the promisor for that purpose ; or where one buys out the stock of a tradesman and undertakes to take the place, fill the contracts and pay the debts of the vendor.”
It will be observed that the exception noted above, relating to where one person agrees to pay money to a third, is limited to cases in which the third *229party is the only one interested in the payment, and that the exception relating to the promise to pay the debt of another is confined to cases where the promise rests upon the fact that the money or property is placed in the promisor’s hands for that purpose. A mere agreement to pay another does not justify a third party in bringing suit upon the agreement, because, presumptively at least, such an agreement is made primarily for the release or benefit of the promisee. Where, however, the promisee puts money or property in the hands of the promisor to be delivered to the third party, or for any other reason the third party is the only one interested in the payment or delivery, the case falls, as pointed out by Mr. Justice Kephart, within the exceptions noted, and the third party can sue upon the promise.
The different results following upon the circumstances indicated illustrate and confirm the underlying test for determining whether a third party can sue upon a contract, namely, whether it was made primarily for the benefit of the promisee or of the third party. This test is equally controlling in cases of bonds given to insure the performance of both public and private contracts. In public contracts, however, questions of acts of assembly enter into and at times confuse the issue, but a careful analysis of the decisions will show that such cases were ultimately solved upon the basis of the controlling test already indicated. Thus, in some suits on public bonds it has been intimated, notwithstanding that the language used in the bonds there considered disclosed that they were intended to protect subcontractors, and were, therefore, primarily for their benefit, that the subcontractors could not maintain the actions, because in each case only one bond was given, and the pertinent acts or ordinances provided for “additional” bonds to be given by the contractors: Erie, to use, v. Diefendorf et al., 278 Pa. 31; Lancaster v. Frescoln, 192 Pa. 452, 456. It is difficult to follow a line of reasoning which concludes that a bond manifestly given for the protection of subcontractors was not in fact and in law so given merely because a second bond for another purpose was not also given so as technically to make the former an “additional” bond, but such seems to be the trend of our authorities.
So, also, rules for the interpretation of the language of bonds, the reasons for which exist in cases of private bonds but do not exist in the case of public bonds, have been applied so consistently to the latter that we are not at liberty to ignore them. For example, it has been held that where the condition of a bond is to the effect that the contractor will “pay for labor and materials,” the primary purpose is to protect the owner: Greene County v. Southern Surety Co., 292 Pa. 304. On the other hand, if. the language of the condition is that the contractor will “pay to each and every materialman and laborer all sums due for work and materials,” the primary purpose has generally, though not always, been held to be to protect the latter and not the owner. Justification might be found in the circumstances of private bonds for such a distinction, because a private owner is subject to the risk of liens being filed against his property, and thus being held responsible to subcontractors for labor and materials furnished to the contractor with whom alone the owner dealt. It might, therefore, be urged with some force that an owner, who is exposed to such a risk, is concerned primarily with his own protection, and incidentally only with the protection of third persons, if he merely requires an agreement that his contractor will ■ pay for labor and materials. The reason, however, which sustains such a distinction in private bonds does not exist in public bonds. Public property is not subject to liens for labor and materials, and by no stretch of imagination could the state be harmed by the failure of a contractor to pay his subcontractors. It needs no *230protection against the claims of unpaid subcontractors. How, then, can it be said to have acted primarily for its own protection, when it exacts from a general contractor a bond conditioned upon his paying subcontractors, whether the language used be in the one form or the other?
In determining, therefore, into which of the two lines of decisions indicated the language of a particular bond falls, we must consider not only the circumstances surrounding the giving of the bond, but also the precise language used. “As a general rule, a surety on a bond given for the performance of public or private contracts cannot be held liable to third persons who furnish labor and material, though the obligation requires the contractor to pay for labor and materials:” Greene County v. Southern Surety Co., supra. See, also, Lancaster v. Frescoln, 192 Pa. 452, 203 Pa. 640; Board of Education v. Massachusetts Bonding & Ins. Co., 252 Pa. 505; Erie, to use, v. Diefendorf et al., 278 Pa. 31. If, however, the bond is given under a statute which requires one to be taken for the protection of materialmen, and the language used is apt for that purpose, recovery against the surety can be had by the third party beneficiary: H. H. Robertson Co. v. Globe Indemnity Co., 268 Pa. 309. We think the bond in the case before us falls within the class ruled by the last case cited. In that case, the bond was given under the State Highway Act of May 31, 1911, P. L. 468, which required bonds for the protection of subcontractors, and provided in language identical with the act that the contractor would “well and truly pay to all and every person furnishing material or performing labor in and about the construction of said highway, all and every sum and sums of money due him, them, or any of them, for all such labor and materials for which the contractor is liable.” In discussing this language, Mr. Justice, now Chief Justice, Frazer said: “This language clearly indicates an intention upon the part of the legislature to protect persons furnishing work and materials in the construction of highways, it being in the interest of the Commonwealth to secure high grade work by providing adequate provision to insure to competent workmen and materialmen payment of their claims upon the completion of the work: Phila. v. Stewart, 195 Pa. 309, 313. Com. v. National Surety Co., 253 Pa. 5, 10. In the latter case the act now in question was before this court for construction and we affirmed the case on the opinion of the court below, in which it was stated that, while a simple agreement with the Commonwealth to pay all wages and for materials would be insufficient to support an action by a materialman in his own name, yet ‘the statute provides for an agreement to pay the workmen and the materialmen and in the bond it is so agreed.’ True, the bond there contained an additional provision, not found in the obligation here, to the effect that persons having a claim against a contractor for labor done or materials furnished ‘shall have the right to bring suit upon this obligation and to recover such sum as may be justly due him or them, if such suit be brought in the name of the Commonwealth of Pennsylvania for the use of the person or persons having such claim;’ aside from this provision, however, the wording of the statute alone shows an intention to confer upon those furnishing labor and materials a beneficial interest in the bond by requiring the obligors to ‘pay to’ them ‘all and every sum’ which might be due them. This provision, when incorporated in the bond, constitutes an express promise for the benefit of third persons and will support an action either in their own name or in the name of the Commonwealth for their use. The furnishing of work or materials in reliance upon the provision of the statutory bond furnishes ample consideration for the promise.”
In the case before us, the Act of 1903 provides that the bond shall be given, not for the benefit of the Commonwealth, but “to protect” the subcontractor-*231Certainly this is as clear an expression of the legislative purpose primarily to, benefit subcontractors as is the language of the State Highway Act involved in the Robertson Company case. The language of the bond itself also indicates the primary intention to benefit the subcontractor. Its condition is that the contractor will “pay all lawful claims of subcontractors, materialmen and laborers for labor performed and materials furnished in the carrying forward” of the contract. This language binds the contractor to do more than merely to pay for labor and materials. It not only implies the act of paying, but also designates the thing to be paid and the person to whom payment is to be made. It is an agreement that all subcontractors will be paid their lawful claims by the contractor. It may be more terse than the language used in the bond in the Robertson Company case, but it is no less clearly the equivalent of an undertaking to “pay to” the materialmen their claims. To hold otherwise would, in our judgment, be refining a refinement to the vanishing point.
The purpose of the bond in this ease being to protect subcontractors and not the Commonwealth, as expressly declared by the Act of 1903, we conclude that the plaintiff is entitled to maintain this suit in its own name against the surety in the bond; and the affidavit of defense raising questions of law is, therefore, adjudged insufficient, with leave to the defendant to file an affidavit of defense to the merits within fifteen days.