
600 P.2d 274 (1979)
93 N.M. 328
In the Matter of the ESTATE OF Lois Faye SEYMOUR, Deceased.
Dale Allen SEYMOUR, Individually and as Special Administrator and Personal Representative, Vicki McClintic and Andrew J. Gonzales, Petitioners,
v.
Jay Lynn DAVIS, aka Jay Davis, Respondent.
No. 12386.
Supreme Court of New Mexico.
September 6, 1979.
*275 Clayburgh, Ashby, Rose & Paskind, Stewart Rose, III, Albuquerque, for petitioners.
John P. Dwyer, Albuquerque, for respondent.
W. Garrett Flickinger, Pamela Minzner, U.N.M. School of Law, Albuquerque, amicus curiae.

OPINION
PAYNE, Justice.
This dispute arose over the admissibility to probate of Lois Faye Seymour's will. The district court admitted the will to probate over the objections of her son, Jay Lynn Davis, and held that Davis should be disinherited for contesting it. On appeal, the Court of Appeals reversed the district court. We granted certiorari and now reverse in part and affirm in part the decision of the Court of Appeals.
The decedent executed the will at issue in October 1971 while she was married to Dale R. Seymour. Excepting a few specific bequests, the will provided that her estate was to go to her husband, unless he predeceased her, died simultaneously with her, or died within sixty days following her death. In any of those events an alternate disposition provided that Davis, her son, would receive $10,000 plus certain mortgage notes. *276 The alternate disposition also provided that the residue of her estate would go to her stepson, Dale Allen Seymour, an appellee.
After execution of the will, the decedent divorced Dale R. Seymour in September 1975. Lois Faye Seymour died in March 1977. The decedent's former husband makes no claim and asserts no rights under the will. The district court admitted the will to probate over Davis' objections and entered an additional finding that Davis was disinherited under a provision in the will which stated:
I expressly provide that if either JAY LYNN DAVIS or DALE ALLEN SEYMOUR shall contest the terms and provisions of this Will, making claim that he is entitled to a greater share of my estate than is provided herein, or contesting in any way the terms and provisions hereof, then I direct that said son shall be disinherited.
Davis argues on appeal that his mother's will was revoked on the date of divorce by operation of § 30-1-7.1, N.M.S.A. 1953 (Supp. 1975) enacted in 1967. He argues that the statute which was in effect on the date of divorce did not prescribe an alternative disposition of the estate following revocation of the primary dispositive provisions.
Section 30-1-7.1 of the old law provides as follows:
B. If after making a will the testator becomes divorced, all provisions in the will in favor of the testator's spouse so divorced are thereby revoked.
C. Except for the circumstances described in subsections A and B of this section and the provisions of 29-1-16 and 30-1-7 New Mexico Statutes Annotated, 1953 Compilation, no written will nor any part thereof can be revoked by any change in the circumstances or condition of the testator.
Davis therefore argues that the alternative distribution of the estate cannot be given effect, and thus that the alternative distribution of the estate should be distributed under the New Mexico intestacy laws. Davis asserts that the district court order was contrary to the decedent's intention. Davis further asserts that he did not intend to contest his mother's will as such, but only to have a court construe the meaning and effect of the will.
The appellees argue that the decedent's will was not revoked at the instant of her divorce since wills are "ambulatory" until the instant of death. They argue that the Legislature's enactment of the Probate Code, specifically § 45-2-508, N.M.S.A. 1978, prior to decedent's death governs the effect of the divorce.
Section 45-2-508 provides:
A. If after executing a will the testator is divorced or his marriage annulled, the divorce or annulment revokes any disposition or appointment of property made by the will to the former spouse, any provision conferring a general or special power or appointment on the former spouse, and any nomination of the former spouse as personal representative, trustee, conservator or guardian, unless the will expressly provides otherwise.
B. Property prevented from passing to a former spouse because of revocation by divorce or annulment passes as if the former spouse failed to survive the decedent, and other provisions conferring some power or office on the former spouse are interpreted as if the spouse failed to survive the decedent.
.....
E. No change of circumstances other than as described in this section revokes a will.
The pertinent distinction between the application of the two sections is that under the prior law the provisions relating to the divorced spouse are revoked, while under the present law the divorced spouse is considered to have predeceased the testator.
The Court of Appeals held that revocation of the will by divorce takes effect as of the date of divorce and that under § 30-1-7.1(B) of the former law that the decedent's will did not make an effective disposition of her estate. The court further held that there was no practical reason to admit the will to probate and that the "no contest" *277 provision would therefore not be effective to disinherit Davis.
The issues presented are matters of first impression in New Mexico. We will first deal with the matter of whether the old law or the new Probate Code governs the disposition of the decedent's will. We will then deal with the effect of the no-contest provision in the will. While the position taken by the Court of Appeals on the first issue is not without precedent in other states, we feel that the better view and the weight of authority are to the contrary.
Thirty-five states have adopted legislation which revokes wills or will provisions in favor of divorced spouses. In only a few states have courts considered whether new statutes should apply to divorces obtained before the effective dates of the statutes. In the present case, however, we need look only to the legislative intent in the enactment of the Probate Code in New Mexico.
The Probate Code states that "the affairs of decedents dying on or after the effective date of the Probate Code" will be controlled by the provisions of the Code; the effective date of the Probate Code was July 1, 1976, prior to decedent's death in March 1977. N.M. Laws 1975, ch. 257, § 10-101(A). Therefore, the affairs of Lois Faye Seymour's estate are governed by the new Code. We hold that the terminology used by the Legislature encompasses wills of decedents, even though executed prior to the effective date of the Code.
The enabling act distinguishes the term "affairs of decedents" for persons "dying on or after the effective date", N.M. Laws 1975, ch. 257, § 10-101(B), from other matters governed by the Probate Code, such as missing persons, minors and incapacitated persons. In these areas, the Probate Code is effective only where such matters were "commenced on or after the effective date." N.M. Laws 1975, ch. 257, § 10-101(B). Thus it is clear that the Legislature recognized the distinction between the effective date of the Code as it applied to different circumstances governed by the Act. The Probate Code provided for a time lag prior to its effective date. This provided time for adjustments by parties who felt their wills would need to be changed. The Code's planning period provision would not have been necessary if the Legislature had intended the Code to apply only to wills executed after its effective date.
Under the new Code, a testator's will can be revoked in three cases. These are divorce (§ 45-2-508), an omitted spouse (§ 45-2-301, N.M.S.A. 1978), and a pretermitted child (§ 45-2-302, N.M.S.A. 1978). In each of these provisions, something in addition to the cited event is required to revoke the will. Additionally, § 45-2-104, N.M.S.A. 1978 imposes a condition of survival on intestate takers. All these provisions point to the testator's death as being the moment of revocatory effect intended by the Legislature. Historically, the statutory scheme for revocations by operation of law allowed a less than total revocation of a will. See § 30-1-7.1, N.M.S.A. 1953. This scheme also required that affected parties survive the testator in order to trigger revocatory effect.
Our holding, that § 45-2-508 controls the effect of divorce on the construction of the unrevoked portions of the will, is supported by modern case authority and the Uniform Probate Code § 2-508, after which our Legislature modeled New Mexico's new Probate Code. The majority of recent cases follow the dictates of the Uniform Probate Code, holding that divorce is equivalent to death. Calloway v. Estate of Gasser, 558 S.W.2d 571 (Tex.Civ.App. 1977).
Two additional factors compel the admission of the Seymour will to probate. First, as previously stated, decedent's will is governed by the new Probate Code because she died after July 1, 1976. To determine whether any of the provisions of decedent's will can dispose of her property, the court must first determine the will's validity and whether it was the last one she executed. Even if decedent's will had no dispositive provisions, its admission to probate is nevertheless necessary because of the revocatory clause contained in it. See Matter of Estate of Gardner, 561 P.2d 1079 (Utah 1977). *278 Second, the decedent appointed a series of successor personal representatives, none of whose service was conditioned on her husband's predeceasing her. The fact that a personal representative for decedent Seymour remains to be designated is another reason for allowing the will to go to probate. § 45-3-203(A)(1), N.M.S.A. 1978; Matter of Estate of Gardner, supra.
Finally, we address the validity of decedent's no-contest provision and whether appellee Davis is disinherited by its operation. On this issue, we agree with the Court of Appeals and overrule the trial court.
We hold that no-contest provisions are valid and enforceable in New Mexico, but they are not effective to disinherit a beneficiary who has contested a will in good faith and with probable cause to believe that the will was invalid. See Hartz' Estate v. Cade, 247 Minn. 362, 77 N.W.2d 169 (1956). No-contest provisions are valuable will devices. They serve to protect estates from costly and time-consuming litigation and they tend to minimize family bickering over the competence and capacity of testators, and the various amounts bequeathed. However, the function of the court is to effect the testator's intent to the greatest extent possible within the bounds of the law. To strictly construe no-contest provisions in the face of obvious indications of unresolved legal questions, such as were present in this case, could result in complete destruction of a testator's intent. Accordingly, where the circumstances upon which a will is based have changed substantially between the time of its execution and the time of its probate, courts should not discourage contests. The circumstances relative to the Seymour will were sufficiently changed to justify appellee Davis in seeking a judicial determination construing its meaning and effect. We hold that Davis is entitled to share in the estate of his mother under her will.
Whenever a beneficiary contests a will in the face of a no-contest provision, he does so at the peril of his bequest. But, when he does so in good faith and for probable cause, his bequest should not be jeopardized by the contest. The court should infer the existence or absence of good faith and probable cause from the totality of the circumstances. See 80 Am.Jur.2d Wills § 1575 (1975); Annot., 125 A.L.R. 1135 (1940); 5 Bowe  Parker, Page on Wills § 44.29 (rev. 1962); Leavitt, Scope and Effectiveness of No-Contest Clauses in Last Wills and Testaments, 15 Hastings L.J. 45, 67, n. 87 (1963); Note, 23 U.Pitt.L.Rev. 767 (1962); Notes, 43 Marq.L.Rev. 528 (1960).
The case is remanded to the district court for such further action as is necessary to conform to this opinion.
IT IS SO ORDERED.
SOSA, C.J., and EASLEY, FEDERICI and FELTER, JJ., concur.
