This was an action brought by plaintiffs, Albright & West, to enforce a mechanic’s lien as subcontractors. The defendants, Smith Bros., as co-partners, are joined as contractors with Frank B. Barrett, as the owner of the building and lot against which the lien is sought to be enforced. The complaint is in the usual form. The defendants answered, and the cause was referred to a referee. The referee’s find*582ings and report were confirmed, judgment and decree in favor of plaintiffs, and a foreclosure of the lien to satisfy the judgment was ordered. The defendant Barrett appeals. The findings of fact by the referee are not questioned. The questions presented to this court upon these findings are purely questions of law. The findings of fact material 'to the issues raised on this appeal are, in substance, asfol ows; The defendant Frank B. Barrett is and was the owner of lot 26, block 6, original plat of Pierre. On the 21st day of August, 1884, he entered into a contract in writing with defendants Smith Bros., by which they agreed to furnish all the material, and to erect and complete a store building on said lot within 40 days from date of contract, for which the defendant Barrett was to pay them $1,290, payment to be made as the work progressed. The building was erected and completed according to the terms of the contract, except as to date of comjdetion, which was not until'October 18, 1884, but it was accepted by Barrett as thus finished. Defendant Barrett paid defendants Smith Bros, on their contract, as the work progressed, $150 August 30, 1884; $500, September 6, 1884; $200, September 13, 1884; $200, September 27, 1884; $100, October 11, 1884;' $100, October 18, 1884; $40, October 28, 1884; — the last being in full payment of Barrett’s obligation to Smith Bros, under said contract. August 25, 1884, plaintiffs, Albright & West, entered into a contract with defendants Smith Bros., by which plaintiffs agreed to furnish lumber and building material to be used in the erection of the store building of defendant Barrett, in pursuance of which the plaintiffs did furnish the defendants Smith Bros., between August 25 and October 11, 1884, lumber, etc., in value of the sum of $382.03, which was used in the erection of said store building. The contract bet-ween plaintiffs and Smith Bros., made August 25, 1884, was to furnish lumber and material as called for and ordered by Smith Bros., except as to glass for the front, — that item amounting to $65 — and after-wards plaintiffs agreed with Smith Bros, to furnish said item of glass for the agreed price of $65, and the glass was furnished. Plaintiffs commenced to furnish the lumber, etc., *583August 25, 1881, and the last was delivered October 11, 1884. On December 10, 1884, plaintiffs, for the purpose of securing a lien, etc., filed an account of their claim for record with the clerk of the district court of Hughes county, and such claim was on said day duly abstracted, etc., in the book of mechanics’ liens. Plaintiff did not file any separate lien claim for said glass within 60 days after September 27, 1884, the date upon which said glass was furnished and delivered. All the materal, etc., was furnished by the plaintiffs to Smith Bros, for said building, except the glass, und.er the contract and with the understanding that the purchase money for same was due as the work upon said building progressed. When the report of the referee came up for confirmation, and for judgment and decree, defendant Barrett moved for a dismissal of the action as to him, upon the ground that the amended complaint • does not state facts sufficient to constitute a cause of action, and to strike out all the evidence taken before the referee, and his findings, on the ground of the insufficiency of said amended complaint, and moved for judgment in favor of said defendant. Each and all of these motions were overruled by the court, and judgment and decree were duly entered against the defendants that plaintiffs were entitled to a mechanic’s lien to secure the amount, etc., against said building and premises, and adjudged that they be sold to satisfy said lien. A large number of assignments of errors was made, but the questions involved in the appeal, and arising upon the errors assigned, are assigned, are as follows: (1) Is it necessary for a subcontractor to allege and prove that notice of a claim for a lien was personally served upon the owner, his agent, etc., by presenting or serving him with a statement of the material so furnished to his contractors, or a copy thereof, within 30 days after the same w as furnished, or at any time whatever, and whether it is necessary, under the mechanic’s lien law as the same was in force at the time of the transaction in suit, for subcontractors to allege and prove that, at the time of filing a claim by such subcontractors, the owner was indebted to the contractor to whom such material was furnished? (2) Are Sections 5469, 5470, Comp. Laws, consti*584tutional when construed to allow subcontractors a lien by simply showing a compliance therewith by filing a claim for a lien with the clerk of the court within 60 days after the last material was furnished, and without presenting or serving the owner with a statement or copy thereof within 30 days after the last of such materials were sold and furnished? (3) Can the plaintiff sustain a lien as to the item of “glass for front,” under the findings of the referee?
This action is based upon the following section of our Code, relating to mechanics’liens: “Sec. 5469. Every mechanic or other person who shall do any labor upon, or furnish any material, machinery, or fixtures for, any building, erection, or other improvements, by virtue of any contract with the owner, his agent, trustee, contractor, or subcontractor, upon complying with the provisions of this chapter, shall have for- his labor done, or material, machinery, or fixtures furnished, a lien upon such building, erection, or improvement, and upon the land belonging to the owner, on which the same is situated, to secure the payment of such labor done, or material, machinery, or fixtures furnished. * * * Sec. 5470. Every subcontractor wishing to avail himself of the benefits of this chapter shall, within sixty days after the material shall have been furnished or labor performed, file, with the clerk of the district court of the county or judicial subdivision in which the building, erection, or other improvement to be charged with the lien is situated, a just and true account of the demand due him, after allowing all credits, and containing a correct description of the property to be charged with said lien, and verified by affidavit; but a failure to file the same within the time aforesaid shall ' not defeat the lien, except as against purchasers or incumbrances in good faith and without notice, whose right accrued after sixty days, and before any claim for the lien was filed, or against the owners, except the amount due the contractor at the time of filing the same.”
An analysis of the law shows clearly that three propositions can be maintained under it: First, that a subcontractor may have a lien for his work or material furnished by virtue *585of a contract with the owner, his agent, trustee, or contractor, upon the building, erection, or improvement upon which such work was done or material furnished, and upon the land on which the same is situated; second, that the amount of such lien is the price agreed to be paid, or its value, for the labor performed and material furnished upon the building, erection, or improvement; third, that the risk of all payments' made to the original contractor, up to 60 days after such work is performed and material furnished, is upon the owner.
The first of these conclusions, under the law, is not seriously contested by the appellant; his contention being that a notice must be given to the owner, by the subcontractor, before or at the time he furnishes any material or performs any labor, of his intention to do so, and the probable value thereof. The law, previous to the amendment of 1883, did require a personal notice to an owner by subcontractors. Section 656, Rev. Code 1877, provides, among other things, as follows: “Every subcontractor, wishing to avail himself of the benefits of this chapter, shall give notice to the owner, his agent or trustee, before or at the time he furnishes any of the things aforesaid, or performs any labor, of his intention to perform the same, and probable value thereof, ” etc.; “and, if afterwards the things are furnished or labor done, the subcontractor shall settle with the contractor therefor, and the settlement in writing, signed by the contractor and certified to be just, shall be given to the owner, ’ ’ etc. This law was amended by the legislature in 1881 by dispensing with service upon the owner of a settlement, and by further protecting purchasers and incumbrancers from the operation of the lien after 60 days had expired from furnishing the labor or materials. The law, as thus amended, was in operation until the legislative session of 1883, when it was further amended by striking out the. words, “shall give notice to the owner, his agent or trustee, before or at the time he furnishes any of the things aforesaid, or performing any labor, of his intention to perform or furnish the same;” and it was in operation and force, as above quoted, at the time of the transaction upon which this action is based. In ascertaining *586the rights of the parties, we must take the law under which their respective rights accrue as we find it at the time the contract was made; and the parties are as much bound by a provision contained in a law as if that provision had been inserted in and had formed a part of the contract. It is of no service to refer to a previous law on the same subject, to aid in construing an existing one, unless there be some latent ambiguity that cannot .be understood except by a comparison with the former enactment. We have, however, referred to the original mechanic’s hen law, and traced the various amendments, to show that it was the evident intention of the legislature to dispense with the necessity of a settlement of the subcontractor with the contractor, and service of said settlement on the owner, when the lien is sought to be established within 60 days after the work is done or material furnished; and also that it was not essential for such subcontractor to serve a notice upon the owner of his intention to work or furnish material for the contractor, in order to entitle him to a lien on the building, etc.
The appellant contends, by a very ingenious, if not plausible argument, that the amendments of 1881 and 1883 do not repeal all the provisions in the original mechanic’s lien law for service of notice of the claim of the subcontractor upon the owner. We cannot, however, agree with him in this contention. The original law of 1877 required a settlement of the subcontractor with the contractor, and service of notice of the claim on the owner, without regard to the time for filing the claim for the lien. The amendment of 1881 stripped the law of the requirement of settlement with the contractor, but retained the necessity of notice. The amendment of 1883 took awaj. the requirement of notice, when the claim was filed within 60 days after the work was performed or material furnished. The law in force at the time the transaptions took place which are the basis of this action provided: (1) That, if a subcontractor files his claim within 60 days after he has furnished the material or performed the labor, he is entitled to his lien without any further notice than such filing may give to the owner. (2) That if a subcontractor does not file his claim within 60 *587days, but does so within six months, then he must make a statement of the same, supported by affidavit, and must give personal notice thereof, with a copy of the statement to the owner, etc., and in such case his lien shall only extend to the balance due the contractor at the time of the service of such notice. The claim under consideration was filed within the 60-days provision. The notices referred to in other provisions of the law do not relate to this claim, but those filed under the last provision of the law, viz., Section 5472.
The appellant further contends that, if the lien law should be so construed as to give a lien to the respondents without giving the owner notice, it impairs the obligation of the original contract, and operates to effect the taking of appellant’s property without due process of law, and is void because unconstitutional. Appellant says that, if respondents have a lien, it is because they may ignore the terms of the contract as to payments, and, if the statute requires this, then it impairs defendant Barrett’s contract, wherein he was required and obligated to pay Smith Bros, as the work progressed. In answer to this, we would say that the liability of the owner of a building which is being erected or repaired to pa.y a subcontractor for labor performed or material furnished is not placed on the ground of a contract made with the owner by the person performing the labor or furnishing the material, because usually there is no such contract between them, but upon the ground that, as the labor and material contributed to the erection or reparation of the building, of which the owner receives the benefit, the law imposes upon him the responsibility, for 60 days, at least, of seeing that the claims are paid. Another object of the law is to prevent collusion between owner and contractor, and thus protect those who have furnished material or performed labor on the building from being defrauded, and, so far as it may be necessary to carry this purpose into effect, the law should be liberally construed. It prevents the owners of real estate from seruring to themselves, without compensation, the benefits of the labor and materials of others, by means of low contracts with irresponsible, or perhaps dishonest, contractors *588Were it otherwise, however, and the lien operated directly upon the contract, it could not have the effect contended for by appelant.
When a contract is entered into by the parties, it is not the contract which creates the lien under the statute, but it is the use of the materials and work upon the premises, the putting of them into the building, and attaching them to the freehold, which entitles the party furnishing them to a lien to the extent of their value. Further it is a well known and elementary principle that contracts must be expounded according to the law in force at the time they were made. The law under which a contract is made is a part of the contract, as much as though it were incorporated into it. When appellant contracted with defendants, Smith Bros., whereby he contracted to pay them for i;he erection of the building as it progressed, and did so, it was at his risk; for the law, which was a part of the contract, said: “If there are subcontractors who have furnished material or performed work for this contractor, they shall have their full pay; if the contractor does not pay them, the owner of the building must pay them; if he does not, they shall have a lien upon the building for sixty days, at least, to enforce their payment.” The inconveniences of the law do not seem to us to be insuperable. They are based upon the real or supposed hardship that in many instances it subjects the owner to the liability of making double payments for the same work or material, and prevents him from making contracts for the erection of buildings, and the furnishing of materials to be paid for otherwise than in money, and many other similar inconveniencies. These might have much force, if addressed to the legislature, the law-making power, and we may have very serious doubts as to the policy or the necessity of such a law, and we ' can with propriety recommend to the legislature that it would be wise and beneficial that it should be changed in this particular; yet. these considerations cannot have much weight against the clear and unequivocal terms of the statute. Still, if these inconveniences exist, they can always be provided against at the time the contract is made. The owner can protect himself *589by a bond or other security, or he may made such a contract as ■will allow' him to withhold from the contractor, for the period of 60 days after the completion of the work, enough to protect the property from liens for work or material performed or furnished by persons other than the original contractor. There are many other states whose mechanic’s lien laws are similar in their main features to ours, and many of them have been construed by the supreme courts of those states, and those decisions are in harmony with the conclusions herein enunciated. We append a few extracts from some of them.
In the case of Barnard v. McKenzie, 4 Colo. 251, the court says: “Laws giving mechanics and material-men a lien on real property their labor or capital has contributed to improve and enhance in value are founded in manifest equity. Such legistion is in behalf of a large and meritorious class, poorly able, as a rule, to sustain loss, and little qualified to secure themselves against it by safeguards of their own suggestion. Notwithstanding the lien was unknown to the common law, and is purely the creation of the statute, in view of its equitable character, we think the statute giving it should be liberally construed so as to advance its objects.” The case of Gardner v. Leek, 48 N. W. Rep. 1120, (decided by the supreme court of Minnesota, June 8, 1891.) was when the mechanic’s lien law of that state was vigorously assailed on the ground that under it the character, the quantity of the labor or material which may be charged upon the property is in no way limited by the contract between the owner and the original contractor; that laborers, material men and subcontractors are not required to pay any attention whatever to the terms of the contract with the owner; that their liens may in the aggregate far exceed the contract price; that it takes out of the owner’s hands the power to say who shall be his agents with authority to charge his property, and gives that authority to subcontractors whom he has never employed.
After stating the above as the grounds upon which the constitutionality of the law was attacked, the court says: “This question is not a new one, but has been frequently raised and *590met in the case of lien laws of various states which contain the same general features, and, while the policy of such laws has been often questioned, yet, so far as we have discovered, they have always been upheld as valid. * * * That while no man can be deprived of his property without his consent, and while the basis of the right to a lien against property is the consent of the owner, yet the contract of the owner with the contractor, made under and subject to the provisions of an existing lien law, is evidence of the authority of the latter to charge the property with the liabilities incurred by him in performing his contract, and operates by virtue of the statute as authority to do so.” The same principle is well stated by Chief Justice Shaw, in Donahy v. Clapp, 12 Cush. 440, as follows: “Such a contract by force of the existing law when it was made, of which the owner is presumed to be cognizant, gives his irrevocable power to his contractor to charge and bind his estate; and, when such power is executed by the actual making of such subcontract, it is in law the act of the owner, hypothecating his own estate to the extent of the price of such labor.” In the case of Parker v. Bell, 7 Gray, 429, it was held under a statute not unlike our own, that a plasterer employed by a builder, who has made a written contract wiih the owner of land to build a house thereon, is entitled to a lien on the house and land. The court says: “The object of the provision of the statute is to create and preserve to the laborer security for the payment of the wages which he earns. It is manifest, from a consideration of the provisions of the successive statutes in relation to the lien of , mechanics upon the estates upon which their labor has been expended, that the legislatures have regarded it as a sound and just principle that all thsse who have, by consent of the Owner, or in pursuance of cor tracts with him for that purpose, contributed to increase the value of his property, should have an interest in it until their rehpective claims for such services shall have been paid and discharged. ” In White v. Miller, 18 Pa. St. 52, it was held that one who furnished lumber and window-sash to a contractor to be used in the erection of a building, had a lien therefor. Chief Justice Gib*591son, in delivering the opinion of the court, said: “As soon as owners of lots cease to be their own builders, they put it in the power of persons employed by them to occasion losses to mechanics and material men which they ought not to bear; and it •was to remedy this mischief that the legislature established the principle that materials and labor are to bo considered as having been furnished on the credit of the building, and not of the contractor. The principle is not only a just, but a convenient, one. Whether the builder be the agent of the owner, or an independent contractor, his appointment to the job creates a confidence in him which was not had before; and' the consequences of a false confidence ought not to be borne by those who had no hand in occasioning it. Nor does the rule of the legislature bear hard on the owner. He has it in his power to determine the price of the building while there are outstanding charges against it, or to stipulate for security against those that might afterward turn.up; and, if he use common prudence, any loss which occurs will eventually fall on the author of it. If he do not, he cannot charge the mechanic or material-man with the consequences of his own supineness.” See. also, Lee v. Burke, 66 Pa. St. 336; Blauvelt v. Woodworth, 31 N. Y. 285; Morrison v. Handcock, 40 Mo. 561; McCrea v. Craig, 23 Cal. 522; Sodini v. Winter, 32 Md. 136; Colpetzer v. Church, (Neb.) 37 N. W. Rep. 931.
The third objection urged by the appellant is that the item of “glass for front” was not purchased under the same contract as the other material for which the lien is sought to be enforced, and consequently cannot be included in it. The referee finds that plaintiffs first agreed with Smith Bros, to furnish all the lumber and building material specified in the account, except the item for “glass for -front;” that afterwards, but on the same day on which such other items were agreed to be furnished, they further agreed to furnish the glass for the front; and that subsequently, on the 27th day of September, 1884, it was iurnished at the agreed price. The question then arises, do these findings show a separate and distinct contract of sale for this item, and should respondents, as appellant contends, *592have filed a separate lien claim for it, which was not done? The law is perhaps well settled that, when work is performed or material furnished under distinct contracts, each must stand on its own merits, and the lien must be filed under each contract within the time limited. Livermore v. Wright, 33 Mo. 31; Phil. Mech. Liens, § 324. But when several agreements relate to the same premises, calling for similar kinds of work or the furnishing of material for the same building, the whole will constitute one transaction to do a stipulated piece of work and to furnish certain materials. Under these circumstances the material may be treated as furnished under one agreement, and each one existing contemporaneously with the other. The ma terials and lumber in the case at bar were purchased and used for the same purposes as the “glass for front.” viz: the erection of a store building. The latter was contracted for subsequently, and, before the materials were all furnished under the first agreement, the “glass for front” was obtained and used. Then, so far as concerns the construction and application of the lien law, the furnishing of all the material, together with the “glass for front,” may be deemed to have been substantially continuous and indistinguishable, rather than independant transactions. Miller v. Bachelder, 117 Mass. 179; Lumber Co. v, Murphy, 64 Iowa, 165, 19 N. W. Rep. 898; Skyrme v. Mining Co. 8 Nev. 219; Rush v. Able, 90 Pa. St. 153; Sash and Door Manuf’g Co. v. Norwegian Seminary, (Minn.) 47 N. W. Rep. 796; Mellor v. Valentine, 3 Colo. 255. If the facts had shown that the materials had been furnished for different purposes, as for instance, a part of them for constructing a house, and the balance at a subsequent time for altering or repairing it, or that such an interval of time had elapsed that it could not with propriety have been called one account, the items must be regarded as constituting two. or more accounts, and furnished for two or more distinct purposes, and as two or more separate and entire contracts, and would be governed by the rules heretofore stated. The filing of the account within the statutory time, when the subcontractor treated the furnishing of the lumber, building material, and the “glass for front” as an entirety, *593we think entitles him to the statutory lien on this item, the same as the other items of the account. No substantial error appearing in the trial of the cause in the court below, the judgment is affirmed.
All the judges concurring.