McLeary, J.
The plaintiff in this complaint in substance alleges the following: “ That on the seventh *388day of June, 1885, the defendant Newton executed and delivered to the defendant Whitney a certain chattel mortgage on forty head of stock-cattle, providing, among other things, that, in case of default, the sheriff of any county in which the mortgaged property might be found, on direction of the mortgagee, should sell said property pursuant to law, and out of the money arising from such sale pay the debt secured by such mortgage, together with all costs and charges of making the sale; and that, upon default, the defendant Whitney authorized and directed C. W. Savage, the then sheriff of Custer County, on or about the fourth day of August, 1886, to take possession of the said stock-cattle so mortgaged by said Newton, for the purpose of foreclosing said mortgage upon them; that in pursuance of such direction so made by said Whitney, the said sheriff, by his duly authorized deputy, did, as the agent of said Whitney, take possession of said cattle, to the number of about forty head; that the said sheriff was by the said Whitney directed to have the said cattle held, and not to sell the same till directed to do so by him, the said Whitney; that the said sheriff did then and there, by his said deputy, and acting for and on behalf of said Whitney, and as his -agent in that behalf, request and direct this plaintiff to take possession of said cattle, and keep, feed, herd, and pasture the same for the said Whitney till further directed; that this plaintiff did then, to wit, on the said fourth day of August, 1886, take possession of said cattle, and the same were, by the said sheriff, intrusted to him, and he has ever since that time had, and now has, possession of said cattle; and has during all that time, thence till now, kept, fed, herded, and pastured said cattle; that the said sheriff, by his said deputy, acting for and on behalf of said Whitney, did then and there undertake and promise to pay this plaintiff, the reasonable value of keeping, feeding, herding,' *389and pasturing said cattle during the time plaintiff might so keep them; that, for some reason to this plaintiff unknown, the said Whitney caused and directed the said cattle not be sold by said sheriff; and plaintiff, upon information and belief, alleges that now, within the past month or thereabouts, the said Whitney has settled the indebtedness of said Newton to him, and has released the cattle held by plaintiff as aforesaid from said mortgage; that plaintiff, before the commencement of this suit, and learning of the settlement of the suit between said Whitney and Newton, demanded from them his pay for keeping, feeding, and pasturing said cattle as aforesaid, at reasonable compensation, but both said Whitney and said Newton refused to pay the same; that said Newton has demanded of plaintiff that he deliver to him the said cattle without paying plaintiff for the keeping of said cattle as aforesaid, nor has the said sheriff, or any one else, paid plaintiff for such keeping; that the reasonable value of keeping, herding, pasturing, and caring for said cattle, from the fourth day of August, 1886, when plaintiff took possession of them, till now, is $563.” And he prays for judgment in the sum of $563, and foreclosure of the statutory lien upon the mortgaged cattle for said sum. To this the defendants severally demur, upon the ground “ that the plaintiff’s complaint herein does not state sufficient facts to constitute a cause of action.” This demurrer was sustained by the court, and thereupon the plaintiff declined to amend, and abode by the complaint; and the court rendered judgment in favor of the defendants, from which the plaintiff takes this appeal.
It will be observed that the only question which arises in the consideration of this case is, whether or not the plaintiff has a lien upon the cattle under the facts stated in the complaint. This involves the construction of section 1394 of the fifth division of the Compiled *390Statutes of Montana, which reads as follows: “ That any ranchman, farmer, agistor, or herder of cattle, tavern-keeper, or livery-stable keeper, to whom any horses, mules, asses, cattle, or sheep shall be intrusted, and a contract for their keeping be entered into between the parties for the purpose of feeding, herding, pasturing, or ranching, shall have a lien upon said horses, mules, asses, cattle, or sheep for the amount that may be due for such. feeding, herding, pasturing, or ranching, and shall be authorized to retain possession of such horses, mules, asses, cattle, or sheep until the said amount is paid; provided that the provisions of this section shall not be construed to apply to stolen stock.” Comp. Stats. Mont., sec. 1394, p. 1035.
In the construction of this statute, we must, if possible, arrive at the intention of the legislature. Comp. Stats. Mont., sec. 631, p. 225. And in construing the statute, we are required “ simply to ascertain and declare what is, in terms or substance, contained therein, and not to insert what has been omitted, nor to omit what has been inserted.” Comp. Stats. Mont., sec. 630, p. 225. These rules of construction are simply general principles of the common law which have been adopted into our statutes, and we shall endeavor, in the consideration of this case, to give them full force and effect. It appears that this case was decided in the court below upon the authority of the case of Underwood v. Birdsell, 6 Mont. 142. The ground was taken by the defendants below that the sheriff himself, being an agent of the mortgagee, had no authority, through his deputy, to make a contract with the plaintiff for the keeping, feeding, and pasturing of the cattle which were then in his possession. There are certain loose expressions in the opinion of the case above referred to which would seem to sustain this view, but a careful consideration of that case shows them to be obiter dicta, and that the case was *391decided upon entirely different grounds. It was held in the case above mentioned that persons employed to drive cattle from Texas to Montana did not have a lien ujion them for their wages, under the statute herein quoted; that this lien was not given to persons driving on the trail; but that “ the statute was enacted to protect those persons who have a place or places for keeping and caring for the stock named therein, and who contract for such keeping at such places, either for the purpose of feeding, herding, ranching, or pasturing.” 6 Mont. 146. It is also said in that opinion that “the possession of the cattle was intrusted by the company to their agent. He was authorized and empowered to cause the cattle to be removed to their destination. He had the authority to employ the necessary means to this end; but, being an agent himself, he could not appoint an agent for the company, — he could not deliver possession for the. company to an agent appointed by himself. If the cattle were at any time in the custody of the defendants, their possession was the possession of the agent.” 6 Mont. 145. These last propositions are each and every one of them true under the facts of that case, but they were not necessary to the decision. Groom, the agent of the company, did not appoint the plaintiffs as agents, and he did not deliver possession of the cattle to them. But it was not on this account that they failed in their suit, but because they did not come within the class of persons to whom the statute gives the lien. Then it matters not, so far as the decision in the case of Underwood v. Birdsell is concerned, whether the sheriff was acting as the agent of the mortgagee or not; nor does it make any difference in that regard whether or not he discharged his duties through a deputy. Neither is it necessary for us to discuss, in the consideration of this case, whether or not the defendant Whitney had the legal title to the cattle mortgaged. The decisions are not harmonious upon *392that point. It is true that in the case of Eddy v. Kenney, 5 Mont. 502, Mr. Chief Justice Wade, in delivering the opinion of the court, says: “These conditions were valid and legal, and protect the property included in the mortgage against the claims of general creditors. When any of the conditions were broken, the title of the property vested in the mortgagees.” And this proposition is sustained by very able opinions delivered in the cases of Heyland v. Badger, 35 Cal. 409, and in Tannahill v. Tuttle, 3 Mich. 110. But since the decision of the case in 5 Montana, our chattel-mortgage laws have been amended to such an extent that it may well be doubted whether they leave the legal title in the mortgagor or the mortgagee. Comp. Stats. Mont., c. 92, div. 5, p. 1068.
We do not deem it necessary to the disposition of this case either to affirm or to deny the proposition enunciated in the case of Eddy v. Kenney, supra. But, under the allegations of the complaint, it is clear that the sheriff was lawfully in possession of the cattle referred to, and this fact empowered him to make the contract under which the lien is claimed by the plaintiff as a ranch-man. It will be observed, on a perusal of the statute, that the lien is given to ranchmen, farmers, agistors, herders, tavern-keepers, and livery-stable keepers, to whom the cattle, horses, etc., may “ be intrusted, and a contract for their keeping be entered into between the parties for the purpose of feeding, herding, pasturing,” etc. The statute does not say that the contract must be with the owner of such cattle or his agent. It is fair to presume that it was intended to be made between the ranchman and any person having lawful possession of the live-stock; since only one exception is made to the provisions of the statute, and that is this: “That the provisions of this section shall not be construed to apply to stolen stock.” At common law, an inn-keeper had a lien upon animals intrusted to his care, even where *393they may have been stolen and the thief was his guest. Overton on Liens, sec. 123. This statute restricts the lien of inn-keeper3, and extends it, as restricted, to ranch-men, agistors, and other persons. Undoubtedly, it was intended for the benefit of the animals themselves, and consequently, of their owners, that this lien was given to the persons named in the statute for feeding and pasturing such animals under a contract made with any persons having lawful possession thereof. It certainly was not intended that the ranchman should investigate the title to every horse or cow offered to him for keep or pasture before he undertook its care. At least, he was not required to look any further than to see that such animal was not stolen.
Such being our view of the statute under which this lien is claimed, it is only necessary to inquire further ■whether or not the sheriff had authority to make a contract. with the plaintiff through his deputy. It is enacted in the laws of this territory that “ it shall be lawful for the mortgagor of goods, chattels, or personal property to insert in his mortgage a clause authorizing the sheriff of the county in which such property or any part thereof may be to execute the power of sale therein granted to the mortgagee, his legal representative and assigns, in which case the sheriff of such county at the time of such sale may advertise and sell the mortgaged property in the manner provided in such mortgage; and at any such sale made as aforesaid, the mortgagee, or his representative or assigns, may, in good faith, purchase the property so sold, or any part thereof.” Comp. Stats. Mont., sec. 1550, pp. 1071, 1072. Under this statute the sheriff took possession of these cattle in his official capacity, and not solely as the agent of either the mortgagee or mortgagor. He is an executive officer appointed by the law to make the sale of the mortgaged property in compliance with the terms of the mortgage itself. If the *394parties to the mortgage do not choose to employ his services, they are required to go into court and bring a suit for a foreclosure of the mortgage. If he were acting solely as the agent of the parties, or either of them, no statute would be necessary. But inasmuch as he acted under the requirements of the law, he must be held to have been performing an official duty. Of course, the sheriff is authorized to perform all official duties either personally or by deputy, and as it was necessary for the proper carrying out of the powers vested in him by statute that these cattle should be cared for, fed, and pastured until the day of sale, he was authorized, through his deputy, to make a contract with the plaintiff as a ranchman for that purpose, and the lien followed the contract by virtue of the statute.
Holding these views as to the proper construction of the statute in regard to liens for the pasturing of cattle, we cannot escape the conclusion that it was error in the court below to sustain the defendant’s demurrer. Accordingly, the judgment of the court below is hereby reversed, and the cause remanded.
Judgment reversed.
McConnell, C. J., and Galbraith, J., concur.