
661 P.2d 1102 (1983)
Harry MORGAN, Appellant,
v.
STATE of Alaska, Appellee.
No. 6805.
Court of Appeals of Alaska.
April 29, 1983.
Denis R. Lazarus, Anchorage, for appellant.
Charles M. Merriner, Asst. Atty. Gen., Office of Sp. Prosecutions and Appeals, Anchorage, and Wilson L. Condon, Atty. Gen., Juneau, for appellee.
Before BRYNER, C.J., and COATS and SINGLETON, JJ.
COATS, Judge.
Harry Morgan was convicted after a jury trial of bootlegging, in violation of AS 04.11.010 and AS 04.16.200(b)(1). Judge Paul B. Jones sentenced him to three and one-half years, with one and one-half years suspended. Morgan appeals his AS 04.16.200(b)(1) conviction and his sentence. We reverse this conviction and thus do not reach the sentencing issue.

BACKGROUND
AS 04.11.010 prohibits the sale of alcoholic beverages without a proper license. AS 04.16.200(a)-(b) reads:

Unlicensed persons. (a) A person who violates AS 04.11.010 is, upon conviction, guilty of a class A misdemeanor.
(b) A person who violates AS 04.11.010 in [a local option area] is, upon conviction, guilty of a class C felony, if
(1) he has previously been convicted of a violation of AS 04.11.010;
(2) the sale or offer for sale was made to a person under 19 years of age; or

*1103 (3) the quantity of alcoholic beverages sold or offered for sale is 12 liters or more of distilled spirits, 24 liters or more of wine, or 45 liters or more of malt beverages.
In prosecuting Morgan, the state regarded AS 04.16.200(b)(1) merely as a sentence enhancement provision, rather than a substantive offense. Thus, the state failed to present any evidence of a prior AS 04.11.010 conviction to the grand jury which indicted Morgan, and did not allege a prior conviction in the indictment. Morgan moved to dismiss the indictment before trial.[1] The trial court denied the motion, and found that the statute was a penalty provision which did not necessitate grand jury or trial jury determination of the prior conviction issue. Morgan subsequently objected when the court did not allow jury determination of this issue at trial. The court overruled the objection and decided the prior conviction issue itself.

DISCUSSION
We find that AS 04.16.200(b) is a substantive offense. Thus, an essential element of an AS 04.16.200(b)(1) conviction is a defendant's prior AS 04.11.010 conviction. Cf. Mead v. State, 445 P.2d 229, 234 (Alaska 1968) ("felon in possession of firearm" offense embraces essential element of prior conviction), cert. denied, 396 U.S. 855, 90 S.Ct. 117, 24 L.Ed.2d 104 (1969); People v. Johnson, 8 N.Y.2d 183, 203 N.Y.S.2d 809, 168 N.E.2d 641 (N.Y.) (in prosecution for "possession of burglars' instruments after prior conviction," state must allege prior conviction in indictment and prove to jury at trial), cert. denied, 364 U.S. 897, 81 S.Ct. 228, 5 L.Ed.2d 191 (1960). Since Morgan had a right to grand and petit jury consideration of the essential elements of this offense,[2] the trial court erred in not dismissing the AS 04.16.200(b)(1) indictment and in not permitting the trial jury to decide whether the state had proved beyond a reasonable doubt the prior conviction element of this offense.
Three major factors lead us to this conclusion. First, the structure of the statute indicates a distinct offense. Rather than construing subsection (b)(1) in isolation as strictly a repeat-offender sentence enhancement provision, we should consider AS 04.16.200(b) as a whole. 2A C. Sands, Statutes and Statutory Construction § 46.05, at 56 (4th ed. 1973); see United States v. Anderson, 626 F.2d 1358, 1370 (8th Cir.1980), cert. denied, 450 U.S. 912, 101 S.Ct. 1351, 67 L.Ed.2d 336 (1981). Subsection (a) classifies a simple violation of AS 04.11.010 as a class A misdemeanor. Subsection (b) defines a class C felony offense which can be termed "aggravated bootlegging." To commit this offense a defendant must violate AS 04.11.010 in a local option area, and either a) have a prior AS 04.11.010 conviction, b) sell or offer to sell the alcoholic beverage to a minor, or c) sell a specified substantial quantity of distilled spirits, wine or malt beverage. Thus the statute serves a much broader purpose than providing an increased penalty for repeat offenders, and includes factual determinations traditionally within the province of grand and petit juries.
Second, the state argues that we should construe AS 04.16.200(b)(1) similarly to the AS 12.55.125 presumptive sentencing prior conviction procedure. Prior convictions for presumptive sentencing purposes are determined by the court. However, the legislature specifically provided in enacting the presumptive sentencing law that prior conviction issues "shall be heard by the court sitting without a jury." AS 12.55.145(d). The AS 04.16.200(b) aggravated bootlegging statute contains no such mandate, and thus does not demonstrate the legislative intent to withdraw from jury determination the factual issues presented by prosecutions under the statute. "It is presumed that *1104 when [a legislature] drafts a statute it does so with full knowledge of the existing law and with great care for the precise language which must be used to achieve the desired result." Federal Electric Corp. v. Dunlop, 419 F. Supp. 221, 225 (M.D.Fla. 1976); cf. Fry v. State, 655 P.2d 789, 792 (Alaska App. 1983) (legislature "could have easily expressed its intent by including" prior conviction proviso in statute, but did not do so).
Finally, in situations where a penal statute that defines a distinct offense does not deny the accused the rights to grand and trial jury determination of factual issues,[3] we hesitate to construe the statute so as to deny an accused those valuable rights. "[T]he purpose served by grand jury indictment is to give one accused of a serious offense the benefit of having private citizens judge whether there is probable cause to hold the accused for trial. The grand jury protects the innocent from unjust prosecution... ." Adams v. State, 598 P.2d 503, 510 n. 11 (Alaska 1979) (citations omitted); see Johnson v. Superior Court, 539 P.2d 792, 795 (Cal. 1975). Our supreme court has recognized that the trial jury's fact-finding function is one of the fundamental institutions of American jurisprudence. State v. Browder, 486 P.2d 925, 937 & n. 38 (Alaska 1971). This function protects the accused against the possibly unjust exercise of prosecutorial power. Green v. State, 462 P.2d 994, 997 (Alaska 1969), cert. denied, 398 U.S. 910, 90 S.Ct. 1704, 26 L.Ed.2d 70 (1970). Were we to construe AS 04.16.200(b) as merely a sentence enhancement provision, the state would be able to convict a defendant of a felony while completely circumventing both the grand jury and the trial jury on the issues of whether the alleged offense occurred in a local option area, whether it involved a sale or an offer to sell to a minor, whether it involved a sale or an offer to sell a substantial quantity of specific beverages, and/or whether the accused had a prior AS 04.11.010 conviction.[4]
We REVERSE Morgan's AS 04.16.200(b)(1) felony conviction.[5] Upon remand, the state may elect to have Morgan resentenced solely upon his misdemeanor conviction or may properly reindict[6] and retry him on the felony offense.
NOTES
[1]  The state alleges that Morgan's motion was untimely. However, Alaska R.Crim.P. 12(e) allows the trial court to permit untimely pretrial defenses or objections, and the trial court ruled upon the merits of Morgan's motion.
[2]  U.S. Const. amend. VI; Alaska Const. art. 1, §§ 8, 11.
[3]  The prior conviction element comprises two major issues of fact: whether the state has demonstrated the existence of the prior conviction, and whether the state has demonstrated that the defendant was the person convicted. State v. Furth, 5 Wash.2d 1, 104 P.2d 925, 933 (Wash. 1940).
[4]  We recognize that some defendants, unlike Morgan, will not desire to have the state prove their prior conviction at trial. These defendants have the option of stipulating to the conviction. Mead v. State, 445 P.2d 229, 234 (Alaska 1968), cert. denied, 396 U.S. 855, 90 S.Ct. 117, 24 L.Ed.2d 104 (1969).
[5]  We decline to adopt the state's harmless error argument. The grand jury heard absolutely no evidence on an essential element of the felony charge. In Keith v. State, 612 P.2d 977 (Alaska 1980), the supreme court stated that:

The indictment is the foundation underlying a criminal prosecution. If the indictment is seriously flawed, the conviction cannot stand.
A mere formal defect does not require dismissal of an indictment after the guilt of the defendant has been established at a fair trial. But courts do not hesitate to dismiss an indictment, even after a conviction, when the defect in the indictment is substantial. The conviction must be overturned when an indictment is invalid and the error was properly preserved by a timely objection prior to trial.
Id. at 980-81 (quoting Taggard v. State, 500 P.2d 238, 243 (Alaska 1972); footnote omitted). We reiterated this principle in Atchak v. State, 640 P.2d 135, 151 (Alaska App. 1981) (citations omitted): "[C]ourts should not hesitate to reverse a conviction when a substantial flaw in the underlying indictment is found, regardless of the strength of the evidence against the accused... ."
[6]  Since the alleged prior convictions are an element of the felony offense, should the state decide to reindict it must charge such convictions with sufficient specificity to allow Morgan a fair opportunity to prepare his defense. See Donlun v. State, 527 P.2d 472, 473-74 (Alaska 1974); Adkins v. State, 389 P.2d 915, 916 (Alaska 1964); Post v. State, 635 P.2d 1194 (Alaska App. 1981).
