The two questions to be decided in this case are whether the trial court erred in denying defendant’s motion to dismiss alleging that plaintiffs failed to petitionlhe zoning board of adjustment for a rehearing prior to appealing to the superior court and whether a town road closed subject to gates and bars is a ‘^public right of way” as that term is used in the town of Brentwood zoning ordinance so as to require the town to issue a building permit for construction on property adjacent to the road. See RSA 31:75: .RSA *289238:2 (Supp. 1973). Morris, J., reserved and transferred the town’s exceptions to the denial of its motion to dismiss and to the court’s order that a “building permit issue forthwith.”
By a warranty deed dated August 26, 1969, plaintiffs acquired real estate with approximately 558 feet of frontage along Haigh Road in the town of Brentwood, New Hampshire. Haigh Road is a Class VI road which had been closed subject to gates and bars by vote of the town of Brentwood on March 8, 1966. RSA 230:4 VI (Classification of Highways); RSA 238:2 (Supp. 1973) (Discontinuance of Class IV, V, VI Highways, Subject to Gates and Bars).
On December 28, 1973, plaintiffs applied to the Brentwoad building inspector for a permit to construct a single family dwelling on their Haigh Road property. The application was denied by the inspector on December 29 because plaintiffs’ proposed building lot did not border a public right of way for at least 200 feet as required by the zoning ordinance. Brentwood, N.H., Zoning Ordinance art. IV(2) (A) (Residential-Agricultural District, Lot Area and Yard Requirements); art. XIII (1), (5) (Definitions) (1972).
Plaintiffs appealed the denial of their application to the Brent-wood zoning board of adjustment on March 7, 1974. RSA 31:69 (Powers and Duties of Towns, Zoning Regulations, Appeals to Board). After public notice on March 20 and a hearing on March 27, the board voted unanimously to uphold the decision of the building inspector denying plaintiffs’ application. RSA 31:68 (Meetings of Board).
Without petitioning for a rehearing before .the board as.required by statute, plaintiffs appealed to the superior court, claiming that the board’s decision was illegal, unreasonable and unjust . RSA 31:74 (Supp. 1973) (Motion for Rehearing); RSA 31:77 (Appeal from Decision on Motion for Rehearing). Following an order by the superior court to clarify the grounds for the denial, the board of adjustment stated in a letter dated August 22, I974, that “[s]ince Haigh Road is closed subject to gates and bars, the applicant has no frontage as contemplated within the ordinance.” Brentwood, N.H., Zoning Ordinance art. XIII (5) (1972). A Master (Leonard C. Hard-wick, Esq.) determined that Haigh Road was a public right of way and ordered the town of Brentwood to issue a building permit to the plaintiffs in a report approved on October 9 by the Superior Court (Morris, J.).
*290I. Exhaustion of Administrative Remedies
The defendant town contends that the trial court erred in denying its motion to dismiss since plaintiffs failed to petition the board of adjustment for a rehearing prior to appealing to the superior court. RSA 31:74 (Supp. 1973) provides that “[wjithin twenty days after any order or decision of the board of adjustment... any party to the action ... may apply for a rehearing ....” Any doubt that an application for rehearing is normally mandatory prior to appeal is dispelled by RSA 31:75 (Specifications) which requires that “[n]o appeal from any order or decision of the board of adjustment... shall be taken unless the appellant shall have made application for rehearing....” Bourassa v. Keene, 108 N.H. 261, 262, 234 A.2d 112, 113 (1967). The master ruled, however, that the plaintiffs did not have to comply with the statutory requirements since the issue presented to the board of adjustment was a “legal one involving the meaning and interpretation to be given to the wording of the town’s zoning ordinances.”
The rule requiring administrative remedies to be exhausted prior to appealing to the courts is based on the reasonable policies_of encouraging the exercise of administrative expertise, preserving agency autonomy and promoting judicial efficiency. Londonderry v. Faucher, 112 N.H. 454, 456, 299 A.2d 581, 582 (1972); 3 K. Davis, Administrative Law Treatise § 20.01, at 56 (1958) (Supp. 1970, at 642); McKart v. United States, 395 U.S. 185, 193-94 (1969); L. Jaffe, Judicial Control of Administrative Action 425 (1965). On both the state and the federal levels, the rule as applied by the courts has evolved into a flexible one which recognizes that exhaustion is unnecessary under some circumstances. K. Davis, Administrative Law Text § 20.01, at 382 (1972); 3 K. Davis, Administrative Law Treatise § 20.01, at 56 (1958) (Supp. 1970, at 648). In this State we have not always required a party to exhaust administrative remedies where the constitutionality of an ordinance is in question or where the agency lacks authority to act. Londonderry v. Faucher, 112 N.H. 454, 456, 299 A.2d 581, 582 (1972); Biron v. New Ipswich, 111 N.H. 343, 344, 283 A.2d 683, 684 (1971); Bethlehem v. Robie, 111 N.H. 186, 278 A.2d 345 (1971).
To require the plaintiffs under the circumstances of this case to apply for a rehearing pursuant to RSA 31:75 would serve neither the purpose of the statute nor the policies behind theTexhaustion rule. The evident design of RSA 31:72 to :77 is to give the board of adjustment which is close to the local situation the first opportunity *291to resolve a question on the basis of its particular expertise and to correct any errors which it may have made initially. See Vannah v. Bedford, 111 N.H. 105, 108, 276 A.2d 253, 255 (1971). Where the board is asked to make a discretionary determination, exact compliance with the statute allows the agency to rgassessjthe. facts and to use its expertise to reach a different conclusion which may preclude judicial review. Bourassa v. Keene, 108 N.H. 261, 263, 234 A.2d 112, 113 (1967).
In this case, however, the question before the Brentwood board of adjustment was one of law, i.e., whether a yoad closed subject to gates and bars is a public right of way. RSA 238:2 (Supp. 1973); Brentwood, N.H., Zoning Ordinance art. XÍII (1), (5) (1972). After a hearing the board decided unanimously that Haigh Road was not a public right of way. See Supry v. Bolduc, 112 N.H. 274, 276, 293 A.2d 767, 769 (1972). Where the only remaining issue before the board was a narrow legal one, rigid adherence to the statute requiring an application for a rehearing prior to appealing to the superior court was not necessary. 3 K. Davis, Administrative Law Treatise § 20.09, at 106-07 (1958) (Supp. 1970, at 665); L. Jaffe, Judicial Control of Administrative Action 434 (1965); see Schotland, Judicial Review of State Administrative Action, 26 Ad. L. Rev. 93, 104 (1974).
II. Status of Haigh Road
The town of Brentwood also maintains that the master erred in ruling that Haigh Road is a public right of way as that term is used in Article XIII of the Brentwood zoning ordinance. The Brentwood zoning ordinance requires that “[n]o building lot shall be less than eighty thousand (80,000) square feet, and shall have a minimum continuous lot frontage of two hundred (200) feet. ...” Brentwood, N.H., Zoning Ordinance art. IV (2) (A) (1972). Frontage is defined by the ordinance as “the length of the lot bordering on the public right of way”; a right of way “means and includes all town, state and federal highways, rights of way dedicated to the public use . . . .” Brentwood, N.H., Zoning Ordinance art. XIII (1), (5) (1972). If Haigh Road is a public right of way within the meaning of the ordinance, plaintiffs have adequate frontage for constructing a residence on their land and a permit should be issued to them as the master directed.
Whether Haigh Road is a public right of way under the provisions of the Brentwood zoning ordinance depends upon the effect of the town’s vote on March 8, 1966, to close it subject to gates and bars. *292Plaintiffs argue that the only results of the town vote were to relieve the town of maintenance responsibility and of tort liability with respect to Haigh Road, not to alter the road’s status as a public right of way. RSA 238:6 (Towns Not Liable after Discontinuance).
Perkins, Holland, Donovan & Beckett (Mr. William H.M. Beckett orally) for the motion. Kearns &? Colliander (Mr. Peter F. Kearns orally) opposed.RSA 238:2 provided that“[a]ny class IV, V, or VI highway, or any portion thereof, may be discontinued as an open highway and made subject to gates and bars, by vote of the town.” Effective August 29, 1969, RSA 238:2 was amended to provide that “[s]uch a discontinued highway shall not have the status of a publicly approved street.” RSA 238:2 (Supp. 1973); Laws 1969, 332:2. The language of the amended statute is clear that the vote of a town to close a road subject to gates and bars discontinues the road’s status as a publicly approved street. Any doubt as to the effect of the 1969 amendment to RSA 238:2 is removed by the legislative history in which the bill’s sponsor (Sen. Jacobson) stated that the amendment established the “fact that a highway subject to gates and bars is not an approved public street.” N.H.S. Jour. 893 (1969).
The Brentwood board of adjustment unanimously determined that “[sjince Haigh Road is closed subject to gates and bars, the applicant has no frontage as contemplated within the ordinance.” Implicit in that determination is a finding that a road which is no longer a publicly approved street is not a “public right of way” as that term is used in the Brentwood zoning ordinance, and the board’s conclusion was not erroneous. See K. Davis, Administrative Law Text § 30.06, at 552 (1972); L.Jaffe, Judicial Control of Administrative Action 614-15 (1965).
Defendant’s exceptions sustained in part.
Duncan, J., did not sit: the others concurred.