The plaintiff, William O’Brien, appeals the order of the Superior Court (Galway, J.) approving the Master’s *436(Stephanie T. Nute, Esq.) recommendation that the plaintiff’s petition for grandparent visitation rights, RSA 458:17-d (1992), be dismissed without prejudice. The trial court found that the plaintiff lacked standing, and that the plaintiff’s petition was insufficient on its face. Finding that the court erred with respect to standing, we nonetheless concur that the plaintiff’s petition was legally insufficient. Accordingly, we affirm.
In 1995, the plaintiff filed a petition in superior court asserting that he was the grandfather of the defendant’s child and that he was entitled to visitation under RSA 458:17-d. The défendant and the father of the child were never married. The plaintiff asserted that he had been denied visitation with his grandson and that visitation was in the child’s best interest.
In determining whether the plaintiff had standing to seek visitation, the trial court assumed, without deciding, that the plaintiff enjoyed grandfather status, but nonetheless concluded that RSA 458:17-d did not confer standing upon him-. The court reasoned that the statute granted grandparents standing to seek visitation only when the grandchild’s family structure was threatened by certain specified litigation. The visitation statute provides that
[gjrandparents, whether adoptive or'natural, may petition the court for reasonable rights of visitation with the minor child as provided in paragraph III. The provisions of this section shall not apply in cases where access by the grandparent or grandparents to the minor child has been restricted for any reason prior to or contemporaneous with the divorce, death, relinquishment or termination of parental rights, or other cause of the absence of a nuclear family.
RSA 458:17-d, I. The trial court found no indication of pending litigation related to divorce, death, relinquishment or termination of parental rights and ruled that the plaintiff lacked standing to invoke the statute. The court also ruled that even if the plaintiff had standing to seek visitation, he failed to allege sufficient facts to state a cause of action under the statute. This appeal followed.
As with every other statute,, we construe the grandparent visitation statute as a whole, with an eye towards avoiding absurd results. Dionne v. City of Manchester, 134 N.H. 225, 228, 589 A.2d 1016, 1018 (1991); cf. Petition of The State of New Hampshire (State v. Langille), 139 N.H. 705, 707, 661 A.2d 766, 768 (1995). A cursory reading of the first sentence of the grandparent visitation statute might suggest that a grandparent has standing at all times, and in all circumstances. See RSA 458:17-d, I.. Other provisions of RSA 458:17-d only make sense, however, if standing is limited to the. *437circumstances detailed in the second sentence of the statute. RSA 458:17-d, I, II(e), III. When interpreting statutes, this court presumes that the legislature did not enact nonsensical and unnecessary provisions, DeWees v. N.H. Bd. of Pharmacy, 130 N.H. 396, 403, 539 A.2d 721, 726 (1988), and we therefore conclude that the first sentence of the statute is triggered only when one of the conditions listed at the end of the second sentence has come to pass. RSA 458:17-d, I.
Accordingly, under RSA 458:17-d, I, standing to seek visitation is conferred upon grandparents, whether natural or adoptive, whenever a grandchild’s nuclear family is the subject of “divorce, death, relinquishment or termination of parental rights” unless the grandparent’s access to the grandchild has been earlier, or contemporaneously, restricted. RSA 458:17-d, I. The visitation statute, however, is not limited solely to divorce, death, relinquishment or termination of parental rights. It also envisions standing to request visitation upon the occurrence of some “other cause of the absence of a nuclear family.” Id. When the legislature has clearly delineated the class that can petition to enforce a statutory scheme, this court will implement that determination meticulously. In re Guardianship of Raymond E., 135 N.H. 688, 691, 609 A.2d 1220, 1221-22 (1992). Any other approach might well thwart the legislature’s goals and intentions.
On the record before us, it is apparent that the trial court failed to consider whether the defendant’s status as an unwed parent might qualify, by itself, as a statutory circumstance resulting in the absence of a nuclear family. We hold that it may. This is confirmed not only by the statute’s purpose but also by the statute’s express recitation of procedures to be followed in circumstances where the grandchild’s parent is unwed. RSA 458:17-d, IV; see also N.H.S. Jour. 1377-78 (1989). Further, in providing guidance to the trial court evaluating grandparent visitation requests, the statute specifically requires a consideration of the “circumstances which resulted in the absence of a nuclear family, whether divorce, death, relinquishment or termination of parental rights, or other cause.” RSA 458:17-d, II(e) (emphasis added). The trial court’s unduly restrictive interpretation of the visitation statute was error.
We next address the sufficiency of the plaintiff’s petition. The petition cites no basis for the award of visitation other than the conclusory statements that “[t]he provisions of RSA 458:17-d authorize visitation” and that visitation is “in the best interest. . . of the child.” Indeed, the plaintiff’s petition does not even allege *438that he has ever had any contact, meaningful or otherwise, with the child he now seeks to visit. See RSA 458:17-d, II(c).
We accord great judicial deference to parental rights. Roberts v. Ward, 126 N.H. 388, 391, 493 A.2d 478, 481 (1985). Grandparent status, by itself, does not confer an automatic right of visitation. Lo Presti v. Lo Presti, 355 N.E.2d 372, 375 (N.Y. 1976). Though the legislature has conferred standing upon grandparents to request visitation in certain circumstances, whether visitation is ultimately appropriate depends upon compliance with enumerated statutory criteria. RSA 458:17-d, II. Consequently, a court may not permit intrusion upon a parent’s authority unless the grandparent’s visitation petition sets forth sufficient facts to warrant a grant of visitation under the statutory test. Id.
The trial court ruled that the plaintiff failed to detail enough facts in his petition to invoke RSA 458:17-d. Given the cryptic and conclusory nature of the plaintiff’s pleading, and its failure to address the statutory criteria, we cannot say that the court erred in making this determination.
Affirmed.
All concurred.