
241 So.2d 317 (1970)
EMPIRE HOME LOANS, INC., a Corporation
v.
W. C. BRADLEY COMPANY, a Corporation, d/b/a Columbus Iron Works Company, and Sunbeam Heating & Insulating Co., Inc., a Corporation.
4 Div. 385.
Supreme Court of Alabama.
August 13, 1970.
Rehearing Denied November 19, 1970.
Samples & Floyd, Phenix City, for appellant.
Homer W. Cornett, Phenix City, for Sunbeam Heating & Insulating Co.
Paul J. Miller, Jr., Phenix City, for W. C. Bradley Co., a Corp.
*318 HARWOOD, Justice.
This is an appeal from a decree fixing the priorities between construction loan mortgagees and holders of materialmen's and mechanics' liens.
A. E. McCardle was a home builder in Russell County, Alabama. In 1967, he was the owner of several unimproved lots in three subdivisions which appear to be located in or near Phenix City.
McCardle set about to build houses on these vacant lots. To finance this operation, he executed separate first mortgages on six of the lots. These mortgages were to secure construction loans made by two lending agencies, Empire Home Loans, Inc., a Corporation, and the Phenix-Girard Bank.
Four of these mortgages were executed and recorded prior to the commencement of any work or improvements on the lots covered in the respective mortgages.
As to Lot 26, and Lot 24, both located in Block A, Section Two, of the Asbury Park subdivision, materials were delivered or construction work was begun prior to the recordation of the mortgages. The appellee W. C. Bradley Company had delivered materials of the value of $360.16 to Lot 26, and materials of the value of $879.38 to Lot 24, such materials being used in construction of a house on each lot.
All work done and materials furnished by the appellee Sunbeam Heating and Insulating Company in the construction of houses on all the lots, including Lots 26 and 24, was subsequent to the recordation of the mortgages.
The mortgages held by the two lending agencies were all foreclosed on 5 July 1968, and Empire Home Loans became the purchaser at the foreclosure sale.
After the foreclosure sale, Bradley filed a bill in equity and after setting forth the factual background of the transactions, prayed that all of the respective lots with the completed houses thereon be sold, and that from the proceeds of such sales its materialmen's lien be paid first to satisfy its liens with the balance of the proceeds of the sale to be paid out as directed by the court.
Sunbeam was granted permission to intervene in the proceedings. Its bill of intervention is similar to Bradley's and the nature of the relief sought was directed toward the same end.
The sufficiency of the bill, and the intervention bill is not questioned.
In short, both Bradley and Sunbeam asserted that their liens for labor and materials were superior to, and were to be accorded priority over, the mortgages on all the lots, whether such materials or work was furnished before or after the recordation of the mortgages.
Empire answered that all sums furnished under the construction mortgages were entitled to priority over the respective liens.
In the proceedings below, it was stipulated between the parties that both Bradley and Sunbeam had furnished materials or done work as to each lot, entitling each to a materialmen's or mechanics' lien and that such liens had been duly perfected in accordance with statutory requirements.
It was also stipulated that a sale and removal of the houses on each lot, should the court find that the liens of Bradley and Sunbeam attached to such improvements, would be a detriment to all the parties.
The value of each of the lots prior to the improvements, the amount owed on each mortgage on the date of foreclosure, and the amounts due Bradley and Sunbeam, were all stipulated. The value of the lots with the improvements thereon is not shown by the record. However, it is to be noted that the sums advanced under the construction mortgages are on an average in excess of five times the value of the lots in their unimproved state.
*319 The decree entered by the trial court ordered an individual public sale of the lots in their improved state and fixed the following priorities as to the net proceeds of the sales:
As to Lot 26, Bradley's lien of $546.54 plus interest from 24 April 1968, was established against the improvements on the lot, and was given first priority in the proceeds of the sale.
A lien in the amount of $2,500 (the value of the lot prior to construction of the house on the lot), with interest from 7 September 1967, was established in favor of Empire Home Loans, Inc.
Thirdly, Sunbeams' lien was fixed on the improvements on the lot.
As to the five remaining lots, including Lot 24, a lien was first given to Empire Home Loans on each lot respectively in the amount of the value of each lot in its unimproved state.
Liens were then established in favor of Bradley and Sunbeam on the improvements on the respective lots in the amounts of the value of materials or work furnished by the lienors.
A general provision was made that any proceeds remaining from the sales of the lots after payment of the liens as prescribed, were to be paid to Empire Home Loans toward satisfying any balance owed on advances made under the construction mortgages.
Except as to Lot 26, the effect of the decree was to give to Empire Home Loans a first lien on the proceeds from the sale of the respective lots only to the extent of the value of the lots in their unimproved state, even though the amounts advanced under the mortgage exceeded substantially such unimproved values, and went into the construction of the houses. Of course, the value of the labor and materials furnished by the lien claimants likewise went into the construction of the houses.
If it was reasonably certain that the sale of the properties would produce sufficient sums to pay all of these creditors, this litigation would probably not have arisen. Therefore it seems likely that after a sale of the properties the question that will be presented is how the loss is to be cast in the event the sales do not provide funds sufficient to satisfy the claims of the mortgagee and the lienees.
The priorities of the liens of mechanics and materialmen is governed by the provisions of Section 38, Title 33, Code of Alabama 1940. Before adverting to the provisions of Section 38 as it reads today, and has so read since its predecessor was amended radically in 1933, it will be helpful to refer to this predecessor statute since practically all of the decisional law on the question now presented results from cases decided prior to the 1933 amendment of Section 38.
By Section 8833, Code of Alabama 1923, the liens of mechanics and materialmen were given priority over all other liens, mortgages, or encumbrances created subsequently to the commencement of the work on the building or improvement.
As to the building, such liens were given priority over all other liens, mortgages or encumbrances, whether existing at the time of the commencement of the work, or subsequently created. The person entitled to such lien could have it enforced by a sale of the building, and the purchaser of the building or improvement might have it removed within a reasonable time.
Under Section 8833, and its predecessors, it was firmly established that even though mechanics' and materialmen's liens were given priority only as to the building, a court of equity had plenary power to mold its decrees in such form as to conserve the equities of all the parties; and might, when a removal of the building would in large measure operate as a destruction of the security, order a sale of the property as a whole, adjusting the priorities in the proceeds of the sale on equitable principles. *320 See Baker Sand and Gravel Co. v. Rogers Plumbing Co., 228 Ala. 612, 154 So. 591, for a full discussion of this point supported by numerous authorities.
When the entire property was thus sold to conserve the equities, the rule was that, as to the building, the materialmen's and mechanics' liens were superior to the mortgage lien, regardless of whether they were subsequent to the mortgage.
Under this rule, if the entire property did not bring a sufficient amount upon sale to pay all of the creditors, and sums greater than the value of the land in its unimproved state had been advanced, the construction mortgagee could well be "improved" out of his security for the amounts advanced over the value of the unimproved land. Baker Sand and Gravel Co. v. Rogers Plumbing Co., supra.
In Baker Sand and Gravel, supra, the court took note that while in some states the amounts advanced under a prior construction loan mortgage were given preference, in other states the lien holders and mortgagee were put on equal footing, pointed out:
"But such is not the law of Alabama. The statute expressly provides the lien, any lien under the mechanics' lien law, shall be superior to all mortgage liens as to buildings."
Since its amendment in 1933, Section 38, Title 33, Code of Alabama 1940, reads in pertinent parts:
"Such lien as to the land and buildings or improvements thereon, shall have priority over all other * * * mortgages * * * created subsequent to the commencement of work on the building or improvement; and as to * * * mortgages * * * created prior to the commencement of the work, the lien * * * shall have priority only against the building or improvement, the product of such work which is an entirety, separable from the land, building or improvement subject to the prior * * * mortgage * * * and which can be removed therefrom without impairing the value or security of * * * (the) prior * * * mortgage * * *."
No change is brought about by the 1933 amendment as to the priority of the liens of materialmen and mechanics where such liens have attached prior to the mortgage. Under such conditions the liens of materialmen and mechanics attach to both the land and the buildings.
Under both Section 8833 and the 1933 amendment the liens of materialmen and mechanics created subsequent to mortgages attach to the building only, and are given priority over a prior existing mortgage. However, this priority of the materialmen's or mechanics' liens must be deemed to have been qualified and limited by the following language contained in the 1933 amendment:
"* * * and as to * * * mortgages * * * created prior to the commencement of the work, the lien * * * shall have priority only against the building or improvement, the product of such work which is an entirety, separable from the land, building or improvement subject to the prior * * * mortgage, and which can be removed therefrom without impairing the value or security of * * * (the) prior mortgage."
A new element and significant element is introduced with the enactment of the 1933 Act. The words "without impairing the value or security of any prior mortgage" must be given purpose and effect. These are clearly words of limitation on the right of the mechanic or materialman to have sold and removed the new construction in satisfaction of his lien, i. e., the new construction must be separable from the land and removable without impairing the value or security of the mortgage. These words leave but one subject for further consideration. Do they mean the value or security of the property at the time of the *321 execution of the mortgage or do they mean the value or security of the mortgage itself and of sums advanced on its strength? If the former, the amendment was unnecessary, as already the law was clear that as to the value of the unimproved lot the construction loan was paramount. It follows that the legislative intent must have been to improve the value and security of the mortgage itself. It needs no argument to demonstrate that a construction mortgage which as to all sums advanced under it has priority of mechanics' liens is of more value and security than one impaired by mechanics' liens taking precedence to it except as to the value of the naked earth before the improvements are placed thereon.
If, as we have decided, there is no right to remove and sell the new building when such sale would impair the value or security of an existing mortgage, it follows that the lien of the existing mortgage to the extent of monies advanced thereunder, is paramount and prior to any mechanic's lien thereafter arising.
While under the 1933 amendment the materialmen's and mechanics' lien is yet given priority on the building, such priority may indeed be evanescent if the building cannot be separated from the land without impairing the value or security of the prior mortgage, for in such situations the mortgage retains its priority.
The value of the construction loan mortgages in this case was the amounts advanced under the mortgages. These amounts far exceeded the value of the lots in their naked state. It was stipulated that a removal of the finished houses on the lots would be detrimental to all of the parties. To give priority to the materialmen's and mechanics' liens created subsequent to the recordation of the construction mortgages would impair the value of the mortgages as to monies advanced which exceeded the value of the unimproved lot.
As to Lot 26, the lower court properly gave priority to Bradley's lien since the materials were furnished prior to the recordation of the mortgage.
However, since Sunbeam furnished no work or materials prior to the recordation of the mortgage, the court erred in limiting the lien granted Empire Home Loans, Inc., to the value of the lot in its unimproved state. This lien should have been for the amount of money advanced under the construction mortgage. Any proceeds remaining thereafter should then be awarded toward payment of Sunbeam's lien.
As to the remaining lots, since no work or materials were furnished either by Bradley or Sunbeam until after the mortgages were executed and recorded, the court erred in limiting the lien granted Empire Home Loans to the value of the respective lots in their unimproved state. Empire's lien should have been fixed at the amount of monies advanced under the construction mortgages, and thereafter as to any proceeds remaining, the liens for materials and for work and labor should be adjusted on equitable principles.
Prior to 1933, it would appear that the statutes governing materialmen's and mechanics' liens were weighted in favor of the materialman and mechanic. Since the 1933 amendment, the scales have been tipped in favor of the mortgagee where the mortgage is recorded prior to the commencement of the building operation and the building is inseparable from the land. Either policy is likely to produce inequities.
The vast building industry as operated today is largely conducted on a credit basis. The construction mortgagee furnishes the funds for the construction of a building. The materialmen furnish the materials, and the building contractor or his subcontractor supply the labor and work. All have contributed to the completed building, and all are more or less joint adventurers in the undertaking. In case things go awry and losses take the place of hoped for profits, then on whom should these losses fall?
Our observation, and it must be only an observation, is that as to construction mortgage, *322 and materialmen's and mechanics' liens, we see no reason why these losses should not be apportioned among such creditors in relation to the amounts contributed by each. Those states which provide that the construction mortgage and materialmen's and mechanics' liens shall have equal treatment seem to have a more equitable answer than does Alabama, which gives priorities where equality of treatment would be indicated.
However, this is a matter solely within the province of the legislature. The creation, enforcement, and priorities of materialmen's and mechanics' liens is governed by the prevailing statutes. Such statutes were first enacted in Alabama in 1821. Their legislative development is set out in detail in an article by Hon. J. Edward Thornton, entitled "The Judicial Enforcement of Materialmen's Liens in Alabama," 14 Ala.Law Review, p. 327. Another enlightening article entitled "Priorities Between Mechanics' Liens and Construction Loan Mortgages in Alabama," 23 Ala. Lawyer, p. 398, by Hon. Roy W. Scholl, is suggested reading for those interested.
Regardless of our views as to the wisdom of our statutes, our duty is to interpret the statute as it is written.
For the reasons set forth above, it is our conclusion that the Chancellor erred in those aspects of his decree fixing the priorities and amounts of the respective liens. Accordingly, this decree must be reversed, and the cause is remanded for the entry of a decree consonant with the views expressed in this opinion.
It is to be understood that nothing we have written above is to be deemed to displace the payment of costs as a first payment out of the proceeds of any sale of the properties involved.
Reversed and remanded with instructions.
LAWSON, MERRILL, MADDOX and McCALL, JJ., concur.

On Rehearing
HARWOOD, Justice.
While no application for rehearing was filed in this case within fifteen days of the rendition of the judgment on appeal, the case was placed on rehearing by this court for further consideration of the questions involved. This action was taken within the special term of this court, the term during which the judgment and opinion was rendered and published.
Amicus curiae briefs have been received from parties questioning the soundness of our opinion, and from parties supporting and approving the same. These briefs and the authorities cited therein have received our attention, and the case has again received our careful consideration.
Amicus curiae counsel questioning the opinion, and who represent materialmen, have relied mainly on four cases which they contend should control the question presented, and doctrines of which cases would necessarily lead to a conclusion contrary to that reached by us.
These cases are Baker Sand and Gravel Co. v. Rogers Plumbing and Heating Co., 228 Ala. 612, 154 So. 591; Protective Life Insurance Co. v. Holland Furnace Co., 234 Ala. 38, 173 So. 379; Lary v. Jones, 237 Ala. 575, 187 So. 714, and Polakow v. Weldon, 242 Ala. 505, 7 So.2d 85.
While the opinion in Baker Sand and Gravel, supra, was published in March 1934, counsel for the materialmen state in brief that: "It is true this case arose prior to the 1933 amendment." The opinion itself makes clear that it was based upon an analysis of Section 8833, Code of Alabama 1923. However, counsel argues that had the court felt that the law had been substantially changed by the 1933 amendment, such change would have been noted. Such *323 speculation by counsel cannot prevail in light of the fact that an interpretation of the 1933 amendment was not before the court in Baker Sand and Gravel, supra, but only pre-1933 statute codified as Section 8833 of the Code of 1923. Our present decision of necessity had to be based upon an interpretation of the 1933 amendment.
The original record in Protective Life Insurance Co. v. Holland Furnace Co., supra, which was decided in 1937, discloses that the mortgage involved was executed and recorded on 20 April 1925. The mechanics and materialman's lien involved was recorded in the Probate Office of Jefferson County on 23 February 1932, and the bill to declare and enforce the lien was filed 23 February 1932. Therefore this case was governed by Section 8833, Code of Alabama 1923, as it read prior to its amendment in 1933.
Lary v. Jones, supra, was decided in 1939. The opinion discloses that a bill was filed by a materialman to declare and enforce his lien, and a decree was rendered in favor of the materialman in 1931. A prior mortgagee was not made a party to this bill.
The mortgagee thereafter foreclosed his mortgage in May 1932, and purchased the property at the foreclosure sale, and took possession of the mortgaged property. In 1937 the materialman filed a bill to determine the priorities between his lien and the mortgagee's lien as to buildings erected on the lot. The court overruled a demurrer to the bill and the respondent-mortgagee appealed.
Again, the rights of the parties having been fixed prior to 1933, such rights were not to be determined under or affected by the 1933 amendment. Further, the court stated that the error mainly insisted upon was the bar of the statute of limitations, i. e., whether the latter action against the prior mortgagee was barred by the six months period fixed by Section 8855, Code of Alabama 1923, for proceedings to adjudicate and enforce a materialman's lien as against the owner. In the posture of the case the court had no occasion to consider the effect of the 1933 amendment.
Polakow v. Waldon, supra, involved the action of the Chancellor in overruling a demurrer to a bill to enforce a materialman's lien. This court reversed on the grounds that the demurrer was well taken in that the bill was indefinite and uncertain, and also that it failed to aver when the work on the building was commenced. An interpretation of the 1933 amendment was not presented in proceedings.
We find nothing in the above mentioned cases which should influence a conclusion different from that reached in our original opinion. The question squarely presented in this appeal involved an interpretation of the 1933 amendment. Such question has not previously been before this court insofar as our research discloses. Nor has counsel furnished us with any case which can be deemed influential.
Counsel for the materialmen assert in brief:
"The construction lender can protect himself by taking affidavits from the builder that all bills have been paid, and by advancing the draws on the construction loan jointly to the contractor and his unpaid laborers and materialmen."
Adherence to this suggestion would impose an intolerable, if not impossible, burden on the lender. Assuming an effort be made by the lender to canvass every materialman and laborer in the area, a task hardly feasible as a practical matter, such a canvass would not affect those materialmen and laborers beyond the area of a construction job who may have furnished work or materials to the construction job. Nor do we see how an affidavit from the builder that *324 all bills have been paid, could foreclose unpaid laborers or materialmen from asserting their claims.
On the other hand, a materialman can easily determine the existence, or nonexistence, of a mortgage on the land in question by the simple expedient of an examination of the mortgage records in the office of the Probate Judge.
As stated by Mr. Scholl in his article, which has been referred to in our original opinion:
"The function performed by the construction mortgage lender as illustrated by this example is obviously indispensable, for in this way the owner secures the required short term financing which neither the builder nor the owner is normally able to provide and which the permanent mortgage lender is unwilling to furnish. The lender who makes the construction loan thus performs probably the single most important service contributed in the course of the typical building project.
* * * * * *
"* * * The point is not that the materialman and the contractor should be denied their protection against the owner. But they should not have it at the expense of the lender without whose money there would be no job."
We are yet of the view that our original opinion correctly interpreted the effect of the 1933 amendment to Section 8833, Code of Alabama 1923, (Act No. 64, Acts of Alabama, Ex.Sess.1933, p. 54), which may be found as Section 38, Title 33, Code of Alabama 1940.
Opinion extended; rehearing denied.
MERRILL, BLOODWORTH, MADDOX and McCALL, JJ., concur.
