
8 A.3d 159 (2010)
Judy ATWATER and another
v.
TOWN OF PLAINFIELD.
No. 2009-199.
Supreme Court of New Hampshire.
Argued: January 20, 2010.
Opinion Issued: July 20, 2010.
*160 Clauson Atwood & Spaneas, of Hanover (Bradford T. Atwood on the brief, and K. William Clauson orally), for the petitioners.
Schuster, Buttrey & Wing, P.A., of Lebanon (Barry C. Schuster on the brief and orally), for the respondent, Town of Plainfield.
Thomas R. Hanna, of Keene, by brief and orally, for the intervenor, Townline Equipment Sales, Inc.
*161 BRODERICK, C.J.
The petitioners, Judy Atwater, Carolyn and John McNellis, Diane MacDonald, and Ralph Demasi, appeal an order of the Superior Court (Arnold, J.) dismissing their appeal of a decision of the Town of Plainfield Zoning Board of Adjustment (ZBA) for lack of jurisdiction. We affirm.

I
The record reveals the following facts. At a hearing on August 7, 2006, the Plainfield Planning Board (planning board) voted to conditionally approve an application for site plan review of the intervenor, Townline Equipment Sales, Inc. (Townline). On August 9, 2006, the town administrator, who also serves as the official zoning administrator, sent a formal written notice of the planning board's decision to Townline. The decision stated that the planning board "has conditionally approved the site plan review for the new Townline Equipment Facility," subject to a specific "precedent condition" and four specific "subsequent conditions." On August 23, 2006, after Townline's engineers submitted revised site plans addressing the conditions of approval, the planning board gave final approval to the application.
The petitioners challenged the site plan approval in both superior court and the ZBA. On September 5, they filed a verified petition in superior court pursuant to RSA 677:15 to review the planning board's decision, and on September 6, they filed a "Petition to Appeal Planning Board Decision of Zoning Issue Under RSA 676:5(III)" with the ZBA. We previously resolved procedural issues related to the superior court petition in Atwater v. Town of Plainfield, 156 N.H. 265, 931 A.2d 1220 (2007). At issue in this appeal is whether the appeal to the ZBA was timely filed.
On September 25, 2006, the ZBA denied the appeal on the grounds that it was filed late. In a letter to the petitioners' counsel, the ZBA stated:
The Board of Adjustment is in receipt of your "Petition to Appeal Planning Board Decision of Zoning Issue under RSA 676:5(III)." Under the terms of that statute, appeals to the zoning board must be made within a reasonable time "as provided by the rules of the board." Section 5.5 of the Plainfield Zoning Ordinance provides that appeals of matters like those subject to RSA 676:5 must be appealed to the zoning board within fifteen days of the action which is the subject of the appeal.
Since the appeal was received on September 6, 2006 and the Planning Board action on which the appeal is based occurred on August 9, 2006, more than fifteen days elapsed and therefore the zoning board is without jurisdiction to hear the appeal and therefore declines to take any action on this matter.
The petitioners moved for reconsideration, arguing that: (1) their appeal was made before the fifteen-day deadline; and (2) the fifteen-day period did not begin to run until August 23, 2006. The ZBA denied the request for reconsideration.
The petitioners appealed to superior court. Townline was allowed to intervene. The Town of Plainfield (Town) and Townline each moved to dismiss the case for lack of subject matter jurisdiction, arguing that the petitioners had failed to exhaust their administrative remedies because they had not filed a timely appeal with the ZBA. The petitioners objected. They argued that section 5.5 of the Plainfield Zoning Ordinance (ordinance) does not provide for a fifteen-day deadline for an RSA 676:5, III appeal; that because section 5.5 is silent regarding this appeal period, the reasonable time standard of RSA 676:5, I, *162 applies; and, therefore, they had filed their ZBA appeal within a "reasonable time." They also argued that the Town should be estopped from claiming anything other than a thirty-day appeal period because the town administrator and zoning administrator had advised them that their appeal would be timely if it were filed within thirty days. The petitioners later supplemented their objection, arguing that the appeal period did not begin to run until August 23, 2006, when the precedent condition for final approval had been met.
Shortly after filing their supplemental objection, the petitioners filed a summary memorandum opposing the motions to dismiss. The petitioners stated, among other things, that the Town had recently revealed in a pleading that the Plainfield ZBA did have its own "Rules of Procedure." The petitioners had been unaware of the existence of these rules. The petitioners argued that article 7.1 of the "Zoning Board of Adjustment, Plainfield, New Hampshire, Rules of Procedure" expressly provides that RSA chapter 676 appeals to the ZBA must be filed within thirty days of the date of the signing of the administrative decision being appealed.
The superior court ruled that the petitioners failed to preserve both the argument that because the rules of the board do not define "reasonable time" as fifteen days, they filed within a "reasonable time," and the estoppel argument because they did not raise them in their motion for reconsideration before the ZBA. The trial court also ruled that the planning board's decision with regard to the zoning issue was ripe for appeal on August 9, 2006. Therefore, because the petitioners did not file an appeal with the ZBA within fifteen days of August 9, their appeal was untimely. This appeal followed.

II
On appeal, the petitioners argue that the trial court erred when it dismissed their appeal because: (1) the appeal period began to run on August 23, 2006, the date of the planning board's final approval of Townline's application for site plan review; (2) even if the appeal period began to run on August 9, their appeal was timely filed because the rules of the zoning board provide for a thirty-day deadline for an RSA 676:5 appeal; (3) the fifteen-day appeal period set forth in section 5.5 of the ordinance does not apply, and the petitioners filed their appeal "within a reasonable time"; and (4) the Town should be estopped from asserting the untimeliness of the appeal. The Town and Townline contend that the appeal period began on August 9. They also argue that we should decline to address the remaining arguments because the petitioners failed to raise them in their motion for reconsideration before the ZBA.
"Generally, in ruling upon a motion to dismiss, the trial court must determine whether the allegations contained in the plaintiff's pleadings sufficiently establish a basis upon which relief may be granted." Provencher v. Buzzell-Plourde Assoc., 142 N.H. 848, 852-53, 711 A.2d 251 (1998). In making this determination, the court would normally accept all facts pleaded by the plaintiff as true and view those facts in the light most favorable to the plaintiff. Id. at 853, 711 A.2d 251. However, when "the motion to dismiss does not challenge the sufficiency of the plaintiff's legal claim but, instead, raises certain defenses, the trial court must look beyond the plaintiff's unsubstantiated allegations and determine, based on the facts, whether the plaintiff has sufficiently demonstrated his right to claim relief." Id. (quotation omitted). An assertion that a claim should be dismissed because the trial *163 court lacks jurisdiction to hear the claim due to the plaintiff's failure to exhaust its administrative remedies is one such defense. We will uphold a trial court's ruling in such a case unless its decision is not supported by the evidence or is legally erroneous. Mt. Valley Mall Assocs. v. Municipality of Conway, 144 N.H. 642, 647, 745 A.2d 481 (2000).

III
We first address the petitioners' argument that the trial court erred when it dismissed their appeal because the appeal period began to run on August 23, 2006, and not, as the trial court found, on August 9, 2006. The petitioners argue that because the planning board's August 9, 2006 vote to conditionally approve the application for site plan review contained a precedent condition, it was not a final appealable decision. According to the petitioners, a zoning issue is not appealable until a planning board renders its final approval of the site plan. We disagree.
The question of when a planning board decision interpreting a zoning ordinance becomes appealable presents an issue of statutory construction. The interpretation and application of a statute is a question of law, and we review the superior court's ruling on that issue de novo. Cardinal Dev. Corp. v. Town of Winchester Zoning Bd. of Adjustment, 157 N.H. 710, 713, 958 A.2d 996 (2008). When construing a statute, "[w]e first examine the language found in the statute and where possible, we ascribe the plain and ordinary meanings to words used." Appeal of Garrison Place Real Estate Inv. Trust, 159 N.H. 539, 542, 986 A.2d 670 (2009) (quotation omitted). However, "[w]e do not consider words and phrases in isolation . . . but within the context of the statute as a whole," in order to "better discern the legislature's intent and to interpret statutory language in light of the policy or purpose sought to be advanced by the statutory scheme." Franklin Lodge of Elks v. Marcoux, 149 N.H. 581, 585, 825 A.2d 480 (2003).
To decide the question presented, we consider the language of two related statutory provisions. RSA 677:15, I (Supp. 2009) provides, in pertinent part:
Any persons aggrieved by any decision of the planning board concerning a plat or subdivision may present to the superior court a petition, duly verified, setting forth that such decision is illegal or unreasonable in whole or in part and specifying the grounds upon which the same is claimed to be illegal or unreasonable. Such petition shall be presented to the court within 30 days after the date upon which the board voted to approve or disapprove the application. . . . This paragraph shall not apply to planning board decisions appealable to the board of adjustment pursuant to RSA 676:5, III.
RSA 676:5, III (2008), in turn, sets forth procedures for appeals to a board of adjustment. It provides, in pertinent part:
If, in the exercise of subdivision or site plan review, the planning board makes any decision or determination which is based upon the terms of the zoning ordinance, or upon any construction, interpretation, or application of the zoning ordinance, which would be appealable to the board of adjustment if it had been made by the administrative officer, then such decision may be appealed to the board of adjustment under this section. . . .
RSA 676:5, I (2008) states that "[a]ppeals to the board of adjustment concerning any matter within the board's powers . . . may be taken by any person aggrieved. . . . Such appeal shall be taken within a reasonable *164 time, as provided by the rules of the board. . . ."
Read together, RSA 677:15, I, and RSA 676:5, III establish two separate avenues of appeal from a decision of the planning board, depending upon the nature of the claim. See Hoffman v. Town of Gilford, 147 N.H. 85, 88, 786 A.2d 93 (2001). A party may appeal planning decisions directly to the superior court pursuant to RSA 677:15, I. However, when the planning board makes a decision "based upon the terms of the zoning ordinance, or upon any construction, interpretation, or application of the zoning ordinance," a party must first appeal that decision to the zoning board of adjustment pursuant to RSA 676:5, III. Only after the board of adjustment has rendered a decision may the issue be appealed to the superior court pursuant to RSA 677:4 (Supp.2009).
The plain language of RSA 677:15, I, makes clear that planning issues are ripe for appeal to the superior court when the board has voted to approve or disapprove the application, and that such appeals are to be taken within thirty days of that approval or disapproval. However, RSA 677:15, I, specifically exempts from these appeal requirements appeals pursuant to RSA 676:5, III. The plain language of RSA 676:5, III, in turn, makes clear that when a planning board makes a decision applying or interpreting a zoning ordinance, that decision must be appealed to the zoning board of adjustment pursuant to the procedures set forth for appeals to the board of adjustment under RSA 676:5. RSA 676:5, I, provides that such appeals "shall be taken within a reasonable time, as provided by the rules of the board," but is silent as to when the appeal period begins to run. Absent direction from the language, we look to the overall policy and purpose sought to be advanced by the statutory scheme to aid in our determination. See Smith v. N.H. Bd. of Examiners of Psychologists, 138 N.H. 548, 551, 645 A.2d 651 (1994) (where statute silent as to remedy for violation of time limit, court looked to statutory goals to determine appropriate mode of enforcement).
As we have noted, RSA 677:15, I, and RSA 676:5, III together create two separate appeal processes when a planning board decision is based upon both zoning and planning issues. While the statutes allow a party to appeal planning issues associated with a plat or subdivision directly to the superior court, they also provide for an initial layer of review at the local level for decisions involving the interpretation or application of a zoning ordinance. Hoffman, 147 N.H. at 88, 786 A.2d 93. The legislature has provided this initial layer of review "to ensure uniform application of local zoning laws." Id. at 88, 786 A.2d 93. We believe that the overall policy and purpose sought to be advanced by this statutory scheme is best served by interpreting RSA 676:5, III to mean that a planning board decision about a zoning ordinance is ripe and appealable to the ZBA when such a decision is made. This will allow a zoning board to correct any alleged errors made by the planning board as early as possible in the application review process. We agree with the superior court that "it makes little sense to require that the planning board's approval of a site plan be final before a party can appeal to the ZBA on a zoning issue `including something as fundamental as whether the proposed use is allowed by the zoning ordinance.'"
This is not a case in which requiring a party to wait until a planning board has voted to approve or disapprove the application to bring the appeal would better apply judicial or administrative resources. Cf. Piane v. Town of Conway, 118 N.H. 883, 884, 395 A.2d 517 (1978) (policy of *165 looking less favorably upon requests for interlocutory appeals in civil cases better applies judicial resources). To the contrary, as the Town and Townline point out, planning board reviews may involve months of reviews and meetings. Zoning determinations are often made by a planning board at the very beginning of the application review process, and subsequent decisions by a planning board are often based upon these zoning determinations. Allowing or requiring parties to wait until a final vote of the board before challenging zoning determinations would be inefficient, and would impose significant hardship on applicants seeking site plan approval. As a practical matter, it makes far more sense to resolve the question of whether a planning board's interpretation or application of the zoning ordinance is accurate as early as possible in the application review process.
Nothing in the plain language of RSA 677:15, I, or RSA 676:5, III requires that the planning board first complete its consideration of the planning issues involved in a site plan review, or that the applicant satisfy the conditions imposed on a site plan application prior to the zoning board considering the zoning issues on appeal. Indeed, RSA 676:5, III speaks of appealing determinations made "in the exercise of. . . site plan review," and, unlike RSA 677:15, does not identify the date of the planning board vote to approve or disapprove the application as the date upon which the appeal period begins to run.
The petitioners argue that the planning board's imposition of a "precedent condition" to its site plan approval is "critical to the timing of an appeal in this case." According to the petitioners, it is only after the condition precedent has been satisfied that there is a "final approval that is a `decision of the planning board' from which an aggrieved party may appeal." However, the cases the petitioners cite in support of this proposition involve direct appeals of planning board decisions to the superior court under RSA 677:15, see Prop. Portfolio Group v. Town of Derry, 154 N.H. 610, 913 A.2d 750 (2006), or its predecessor, RSA 36:34, see Sklar Realty v. Town of Merrimack, 125 N.H. 321, 480 A.2d 149 (1984); Totty v. Grantham Planning Board, 120 N.H. 388, 415 A.2d 687 (1980), overruled in part on other grounds by Winslow v. Holderness Planning Board, 125 N.H. 262, 269, 480 A.2d 114 (1984). While these cases hold that only final approval constitutes a decision of the planning board that may be appealed to the superior court pursuant to RSA 677:15, we agree with the superior court that "there is no indication either in these cases or in RSA 676:5, III, that the parties must wait for final approval of the site plan before they bring an appeal to the ZBA challenging the planning board's interpretation or application of a zoning ordinance."
Because none of the parties contends that the decision to conditionally approve the application for site plan review was made on August 7, we assume without deciding, as the trial court did, that the date of the decision was August 9. The board voted to approve Townline's site plan at a hearing on August 7. The planning board then informed Townline that it had approved the site plan in a letter dated August 9. While the planning board imposed a condition precedent on final approval of the overall site plan, the condition did not implicate any issue appealable to the ZBA. Therefore, as the superior court found, "Although the planning board may not have rendered final approval of the plan until August 23, it had already made a decision regarding the zoning issue on August 9."

IV
We next consider whether the petitioners failed to timely file their appeal *166 because they did not file within fifteen days of the August 9 decision. The petitioners argue: (1) that the rules of the zoning board provide for a thirty-day deadline for an RSA 676:5 appeal; (2) regardless of whether the rules of the board apply, the fifteen-day appeal period set forth in section 5.5 of the ordinance does not apply, and the petitioners filed their appeal within a "reasonable time"; and (3) even if their appeal period is fifteen days, the Town should be estopped from asserting the untimeliness of the appeal. The superior court ruled, and the Town and Townline argue on appeal, that the petitioners failed to preserve these arguments because they did not raise them in their motion for reconsideration before the ZBA. We agree.
RSA 677:3, I (2008) provides, in pertinent part:
No appeal from any order or decision of the zoning board of adjustment . . . shall be taken unless the appellant shall have made application for rehearing . . . and, when such application shall have been made, no ground not set forth in the application shall be urged, relied on, or given any consideration by a court unless the court for good cause shown shall allow the appellant to specify additional grounds.
"The statutory scheme is based upon the principle that the local board should have the first opportunity to pass upon any alleged errors in its decisions so that the court may have the benefit of the board's judgment in hearing the appeal." Blagbrough Family Realty Trust v. Town of Wilton, 153 N.H. 234, 238-39, 893 A.2d 679 (2006) (quotation omitted). Thus, if a party fails to set forth in its motion for rehearing alleged errors with respect to the ZBA's decision, the party is barred from raising those grounds in an appeal to the superior court unless the court, for good cause shown, orders otherwise. Id. at 239, 893 A.2d 679.
The petitioners argued at the superior court level, and on appeal to this court, that the ZBA erred when it concluded that the petitioners had only fifteen days to appeal the planning board's decision to the ZBA. The superior court declined to address this argument because the petitioners failed to raise it in the motion for reconsideration they filed with the ZBA. The superior court's ruling is amply supported by the record.
The record reflects that the ZBA concluded that it lacked jurisdiction to hear the petitioners' appeal because RSA 676:5, I, requires appeals to be filed "within a reasonable time, as provided by the rules of the board," and, according to the ZBA, section 5.5 of the ordinance "provides that appeals of matters like those subject to RSA 676:5 must be appealed to the zoning board within fifteen days of the action which is the subject of the appeal." Because the planning board's decision had been made on August 9, and the appeal was filed September 6, the ZBA concluded that it lacked jurisdiction to hear the appeal. The petitioners moved for reconsideration, arguing that their appeal was made before the 15-day deadline, and that the appeal period did not begin until August 23. The petitioners did not, however, challenge the ZBA's conclusion that the length of the appeal period was fifteen days. Following the denial of their motion for reconsideration, the petitioners appealed to superior court. The Town and Townline filed motions to dismiss, to which the petitioners objected. In their objection, the petitioners initially argued that section 5.5 of the ordinance did not apply to an RSA 676:5, III appeal of the planning board's approval of an application for site plan review. They asserted that, "[s]ince the 15 day appeal period set forth *167 in § 5.5 of the Ordinance does not apply and the `rules of the board' are otherwise silent as to a specific time period, then the Court must determine whether the plaintiffs filed their appeal with the ZBA within a `reasonable time.'" In its response to the petitioners' objection, the Town stated that the ZBA did, in fact, have rules of procedure, which were available at the Town office.
Thereafter, the petitioners filed a summary memorandum opposing the motions to dismiss. The petitioners argued, for the first time, that RSA 676:5, I, makes clear that appeals taken pursuant to the statute "shall be taken within a reasonable time, as provided by the rules of the board," and that the rules of the board actually define the appeal period in such cases to be thirty days, not fifteen days. In ruling on the motions to dismiss, the superior court acknowledged that there "may be merit to [the petitioners'] argument" that the applicable rules of the board do not define "reasonable time" as fifteen days, and that an appeal brought within thirty days of the planning board's decision is sufficient, but ruled that it would not consider the issue because the petitioners had failed to raise it in their motion for reconsideration with the ZBA.
On appeal, the petitioners argue that they should not be barred from arguing that the length of the appeal period is thirty days because they were not "aware of the existence of the ZBA's Rules of Procedure . . . until well after their appeal to the superior court, despite their best efforts to determine when an appeal was due." To the extent that the petitioners argue that this provides "good cause" to allow them to raise the issue in superior court despite the fact that it was not raised at the ZBA, we find this argument unpersuasive.
RSA 676:5, I, makes clear that the ZBA's rules of procedure dictate the length of the appeal period. The Town represented in its pleadings at the trial court level that the ZBA has rules that are available for inspection at the Town office. Townline has represented on appeal that the rules of procedure were available for public inspection at the Plainfield Town Clerk's Office throughout the entire appeal period. The petitioners have not challenged either representation. Nor have the petitioners asserted that they ever requested a copy of the ZBA rules of procedure from the Town, or that they at any point went to the Town Clerk's Office and asked to see the rules of procedure.
The petitioners also argue that the superior court erred in dismissing their appeal because, regardless of whether the rules of the ZBA apply, the fifteen-day appeal period set forth in section 5.5 of the zoning ordinance does not apply, and the petitioners filed their appeal within a "reasonable time." Again, the record reflects that the petitioners' motion for reconsideration did not challenge the ZBA's conclusion that the length of the appeal period was fifteen days. Therefore, the superior court did not err when it declined to consider this argument.
Finally, the petitioners argue that the superior court erred in dismissing their appeal because the Town should be estopped from claiming anything other than a thirty-day appeal period. According to the petitioners, the town and zoning administrator informed Atwater that she had thirty days from August 7, 2006, to appeal the planning board's decision, and the petitioners reasonably relied upon that date when filing their appeal. The trial court declined to address this argument because the petitioners failed to raise it in the motion for reconsideration they filed with the ZBA. The record indicates that the *168 issue was raised for the first time at the trial court, in the petitioners' objection to the Town's and Townline's motions to dismiss. Accordingly, the trial court did not err by declining to consider it.
Because we conclude that the petitioners' RSA 676:5 appeal period began to run with the planning board's conditional approval of the application for site plan review, and that the superior court did not err by declining to address the petitioners' remaining arguments, we affirm.
Affirmed.
DALIANIS, DUGGAN, HICKS and CONBOY, JJ., concurred.
