
643 P.2d 857 (1982)
97 N.M. 771
NEW MEXICO BOYS RANCH, INC. and D.B. Stone, Petitioners,
v.
Rosa HANVEY, Respondent.
No. 14087.
Supreme Court of New Mexico.
March 30, 1982.
Rodey, Dickason, Sloan, Akin & Robb, John D. Robb, Albuquerque, for petitioners.
Hinkle, Cox, Eaton, Coffield & Hensley, Paul J. Kelly, Jr., Roswell, for respondent.

DECISION
FEDERICI, Justice.
This appeal involves the construction of a will. The trial court held that by will, Mary *858 E. Martin (testatrix) left her entire estate to New Mexico Boys Ranch, Inc. Rosa Hanvey (Hanvey), testatrix' first cousin, appealed the decision of the trial court. The New Mexico Court of Appeals, 97 N.M. 773, 643 P.2d 859 reversed the trial court, holding that the testatrix died intestate and that Hanvey was entitled to receive her estate. We granted certiorari, reverse the Court of Appeals, and affirm the trial court.
The will in dispute provides as follows:
FIRST: I order and direct my Executrix or Executor, as the case may be, hereinafter named, to pay and discharge all my just debts, expenses of my last illness and funeral expenses as soon as the same can reasonably and conveniently be done.
SECOND: I will, devise and bequeath all the rest, remainder and residue of my estate, real, personal or mixed, wheresoever situated, which I may own or be entitled to at the time of my death unto my beloved mother, Mary M. Martin, absolutely.

THIRD: I hereby declare and state that I have a brother, Aubrey Lee Martin, who is presently living at Socorro, New Mexico, who is the only other person known to me who might expect to share in my estate, and that it is my express will and desire that he receive no part of my estate whatever.

FOURTH: In the event that my death should occur simultaneously with my beloved mother, Mary M. Martin, or approximately so, or in the same common accident or calamity, or under any circumstances causing doubt as to which of us survived the other, then it is to be presumed that my said mother, Mary M. Martin, died first, and the paragraph herein denominated Second shall lapse and be inoperative, and I then, give, devise and bequeath all of the rest, remainder and residue of my estate, real, personal or mixed, wheresoever situated, which I may own or be entitled to at the time of my death, to the New Mexico Boys' Ranch, Belen, New Mexico.

FIFTH: I hereby nominate, constitute and appoint my beloved mother, Mary M. Martin, as Executrix of this my LAST WILL AND TESTAMENT and direct that she be exempt from giving any bond or security for the faithful performance of her duties as such.
SIXTH: In the event of simultaneous death with my mother, as herein specified, then I nominate and appoint D.B. Stone of the Portales National Bank, Portales, New Mexico, as Executor of this my LAST WILL AND TESTAMENT, and direct that he be exempt from giving any bond or security for the faithful performance of his duties as such.
SEVENTH: It is my express will, desire and direction to leave all my property just as I have devised and bequeathed it in this my LAST WILL AND TESTAMENT. I have noted in my lifetime that many times some person or persons have attempted through Courts and otherwise to establish a right to inherit from a deceased person. I do not wish for this to happen in my estate; therefore, should any person or persons other than my beloved mother, Mary M. Martin, establish a right to inherit from me or against my estate of any character whatsoever, or in any manner whatever, then and in the event I hereby give and bequeath unto such person or persons the sum of ONE DOLLAR ($1.00) each, which shall constitute the only share of any such person or persons in my estate. [Emphasis added.]
The testatrix was predeceased by her mother. Following her mother's death and shortly before her own death, testatrix placed the bulk of her property in trust for the benefit of New Mexico Boys Ranch, Inc.
The issue on appeal is whether the intent of the testatrix can be ascertained from the language of her will. If it can be so ascertained, then it controls the distribution of decedent's estate.
The Court of Appeals interpreted Paragraph Fourth of the will to mean that upon the occurrence of the contingency expressed therein, that is, the simultaneous death of testatrix and her mother, the entire estate *859 was to go to New Mexico Boys Ranch, Inc. The Court of Appeals concluded that since the contingency did not occur, testatrix died intestate.
The Court of Appeals held that testatrix' intent is entirely contained in Paragraph Fourth of the will. This interpretation is much too literal and restrictive. The intent of the testatrix must be determined from all of the provisions in the will considered as a whole. In Re Will of McDowell, 81 N.M. 562, 469 P.2d 711 (1970). In construing the will, the intent of the testatrix is the primary consideration, and that intent must prevail if it is consistent with the law. Gregg v. Gardner, 73 N.M. 347, 388 P.2d 68 (1963); Brown v. Brown, 53 N.M. 379, 208 P.2d 1081 (1949). Furthermore, there is a presumption in favor of testacy and against intestacy in a will construction. See Gregg, supra.
In the instant case, it was clearly the intent of the testatrix to bequeath all of her property and to make certain that none other than the designated beneficiaries take any of her estate. This intent is expressed in Paragraph Third, Fourth and Seventh of the will, wherein the only heir known to testatrix is specifically disinherited and all other possible heirs are bequeathed one dollar each. In Paragraph Fourth, the intent expressed is that if testatrix' mother cannot take the estate, then the entire estate is to go to New Mexico Boys Ranch, Inc. The intent of the testatrix is clearly expressed in the will: either one of two beneficiaries (testatrix' mother or New Mexico Boys Ranch, Inc.) was to receive the estate upon the death of testatrix. If testatrix' mother was living at the time of testatrix' death, her mother was to be sole grantee. If her mother was not living at the time of testatrix' death, New Mexico Boys Ranch, Inc. was to receive the estate. All other possible heirs or persons are specifically excluded. New Mexico Boys Ranch, Inc. is the sole beneficiary of the estate of Mary E. Martin.
The Court of Appeals is reversed and the judgment of the trial court is affirmed. The cause is remanded for entry of judgment consistent with this opinion.
IT IS SO ORDERED.
EASLEY, C.J., SOSA, Senior Justice, and PAYNE and RIORDAN, JJ., concur.
