
614 P.2d 536 (1980)
Ivan H. WHITE, Appellant,
v.
WARDEN, NEVADA STATE PRISON, Respondent.
No. 12178.
Supreme Court of Nevada.
July 29, 1980.
Norman Y. Herring, State Public Defender, and J. Gregory Damm, Deputy Public Defender, Carson City, for appellant.
Richard H. Bryan, Atty. Gen., and John C. DeGraff, Deputy Atty. Gen., Carson City, for respondent.

OPINION
MANOUKIAN, Justice:
In September of 1978, appellant pled nolo contendere to a charge of sexual assault. Judgment of conviction was entered in October of 1978 and appellant was sentenced to life imprisonment with the possibility of parole in five years. In April of 1979, appellant filed a petition for a writ of habeas corpus in the district court challenging the voluntariness of his plea. The petition was denied and appellant appealed to this court. Respondent now moves to dismiss the appeal and contends that the legislature, in amending NRS 34.380 in 1979, removed the right to appeal from the denial of a post-conviction petition for habeas corpus.
In Gary v. Sheriff, 96 Nev. 78, 605 P.2d 212 (1980), we concluded that the legislature could constitutionally preclude appellate review of a pretrial petition for a writ *537 of habeas corpus based upon an alleged lack of probable cause. We reserved determination of the question presented here as to the effect the legislative amendment to NRS 34.380 had on appeals from denials of post-conviction petitions. We have determined that the legislature did not intend to abrogate the right of appeal in this context. Accordingly, we deny respondent's motion to dismiss.
In 1979, the Nevada Legislature amended NRS 34.380. 1979 Nev.Stats. ch. 216, § 1, at 312. Section 6 of NRS 34.380, which provided that an applicant "may appeal to the supreme court from the order and judgment of the district judge or district court refusing to grant the writ," was deleted. The state's right to appeal was preserved. NRS 34.380(6), (7) (as amended). Because the deleted section did not previously distinguish between pretrial or post-trial petitions, respondent now argues that there can be no appeal from any denial of a habeas petition.
Of course, we recognize that the intent of the legislature is the controlling factor and that, if the statutes under consideration are clear on their face, we cannot go beyond them in determining legislative intent. Cirac v. Lander County, 95 Nev. 723, 729, 602 P.2d 1012, 1015 (1979); State v. Beemer, 51 Nev. 192, 199, 272 P. 656, 658 (1928). But statutes must also be construed in light of their purpose and as a whole. Thomas v. State, 88 Nev. 382, 384, 498 P.2d 1314, 1315 (1972); Midwest Livestock v. Griswold, 78 Nev. 358, 360-61, 372 P.2d 689, 690-91 (1962). A reading of the entire act  that is, NRS 34.360-.680  reveals some inconsistency.
Although the main subsection allowing for an appeal of a decision on a habeas petition was deleted in 1979, there remain references to a party's ability to appeal. We note that some parties may still appeal from decisions in extradition habeas proceedings. NRS 34.560. And, even though pretrial appeals were abolished in 1979, there is some ambiguity in remaining sections referring to pretrial petitions and appeals. See, e.g., NRS 34.375(1)(b)(3).
In O'Donnell v. District Court, 40 Nev. 428, 165 P. 759 (1917), this court said that the right to appeal is a substantial right and such a right should not be taken away unless such is clearly intended. Id. at 432-33, 165 P. at 759-60. In light of the ambiguity of the action of the legislature, we deem it appropriate to look at the legislative history of the 1979 amendment to determine just what rights of appeal were abrogated.
The legislative history of the 1979 amendments indicates that the legislature was primarily concerned with trial delays due to appeals from denials of habeas petitions. At a hearing by the senate judiciary committee, District Judge Michael Griffin stated that the Judge's Association requested a bill be introduced to limit pretrial habeas corpus appeals. Nevada Senate Committee on Judiciary, Minutes of Feb. 2, 1979, at 3. The subsequent discussion also reflected concern about trial delay and a desire to return authority for a state appeal from the grant of a petition. Id. at 4. At a later meeting, "Judge [J. Charles] Thompson said that this bill is designed to preclude intermediate appeals to the Supreme Court from pretrial denials of petitions for writs of habeas corpus." Nevada Assembly Committee on Judiciary, Minutes of Apr. 6, 1979, at 2-3. The clear import of this legislative history is that the legislature only intended to limit appeals from a pretrial denial of a petition for habeas corpus in criminal cases. We do not agree with respondent state that the excision of former NRS 34.380(6) was a purposeful act by the legislature to preclude appeals from denials of post-conviction habeas petitions. Absent a clear expression from the legislature, we will not find an intent to bar an appeal in the context of this case.[1]
*538 Finally, NRAP 22 provides that "the proper remedy [upon a denial of a habeas petition] is by appeal to the Supreme Court from the order of the district court denying the writ." As we recognized in Gary v. Sheriff, 96 Nev. at 79-80, 605 P.2d at 213-214, this rule fails to have continuing vitality in the context of pretrial habeas appeals due to a clear legislative intent to bar such appeals. Nevertheless, in the post-conviction setting, we arrive at a different result. We consider NRAP 22, as applied to post-conviction habeas appeals, not inconsistent with the legislative intent in the present habeas statutes. See NRS 2.120. As such, we shall continue to regulate post-conviction habeas appeals under our rules. Accordingly, we deny the motion to dismiss this appeal. Respondent shall have thirty days from the date of this decision to file its answering brief.
MOWBRAY, C.J., and THOMPSON, GUNDERSON and BATJER, JJ., concur.
NOTES
[1]  We express no opinion as to the constitutionality of a clear action by the legislature limiting the right to appeal from the denial of a post-conviction petition for habeas corpus. This court will avoid consideration of constitutional questions when such consideration is unnecessary to the determination of an appeal. Union Pacific R.R. v. Adams, 77 Nev. 282, 290, 362 P.2d 450, 454 (1961). We should do so especially in this case where the legislature did not clearly intend to preclude post-conviction appeals by a habeas petitioner.
