¶1 Petitioner Jennifer Leigh Rice, a former public school teacher, molested one of her 10-year-old students. Her conduct was found to be predatory as charged in a special allegation under RCW 9.94A.836. She also abducted the same 10-year-old boy and was convicted of kidnapping with special allegations under RCW 9.94A.835 and .837 for sexual motivation and for having a victim under age 15. The special allegations increased her sentence.
¶2 Rice argues that her convictions should be overturned because the legislature made charging the above special allegations mandatory, in violation of the constitutional separation of powers doctrine. Rice argues that RCW 9.94A-.835 is unconstitutional because it requires a prosecuting attorney to file a special allegation whenever there is sufficient evidence to support the allegation and that RCW 9.94A.836 and .837 are unconstitutional because each requires a prosecuting attorney to file a special allegation whenever there is sufficient evidence to support the alie*889gation and so long as the allegation will not interfere with obtaining a conviction.
¶3 The Court of Appeals held that the charging statutes do not unduly limit prosecutorial discretion because even if a charging requirement is imposed, the prosecutor still must determine whether there is sufficient supporting evidence and whether the supplemental charge would interfere with obtaining a conviction. State v. Rice, 159 Wn. App. 545, 562-63, 246 P.3d 234 (2011).
¶4 We affirm, but on different grounds. We find that the challenged statutes are directory rather than mandatory. Although the statutes authorize special allegations and direct prosecuting attorneys to file them, the statutes do not attach any legal consequences to a prosecutor’s noncompliance, and the legislature elsewhere in the same chapter has acknowledged that prosecuting attorneys retain broad charging discretion notwithstanding statutory language directing them to file particular charges.
¶5 Our interpretation also rests on the fact that the challenged statutes would be unconstitutional if they were mandatory. The charging discretion of prosecuting attorneys is an integral part of the constitutional checks and balances that make up our criminal justice system. Each branch of government plays a distinct role: the legislature checks prosecutors and the judiciary by defining the particular acts and circumstances that may warrant criminal punishment and the maximum sentences that may be imposed; prosecutors check the power of the legislature and the judiciary by deciding whom to charge and which available charges and special allegations to file in any given case; and the judiciary checks the legislature and prosecutors by reviewing probable cause, ensuring a fair trial, and determining the appropriate sentence if the defendant is found guilty. Additionally, the jury checks all three branches of government by deciding in any given case whether the defendant has been proved guilty beyond a reasonable doubt. Within this balanced constitutional framework, each *890branch must act in order for criminal punishment to be imposed, and each exercise of governmental authority may be tempered by mercy. Accordingly, the legislature cannot usurp the inherent charging discretion of prosecuting attorneys; as an executive officer, a prosecuting attorney necessarily has discretion to forgo a supplemental charge even if sufficient evidence exists and regardless of whether the charge would interfere with obtaining a conviction.
¶6 For these reasons, we are confident that the legislature intended RCW 9.94A.835, .836, and .837 to be directory, not mandatory. We uphold the statutes and thus affirm Rice’s conviction and sentence.
I. FACTS
¶7 The parties stipulated to the facts in this case. Stipulated facts generally are binding on the parties and the court. Ross v. State Farm Mut. Auto. Ins. Co., 132 Wn.2d 507, 523, 940 P.2d 252 (1997); State v. Wheaton, 121 Wn.2d 347, 363, 850 P.2d 507 (1993).
¶8 From December 1, 2006 until February 28, 2007, Rice was a fourth grade teacher at a public school in Tacoma, Washington. During that period, Rice had sexual contact with one of her 10-year-old students.
f9 In July 2007, on two separate occasions, Rice had sexual intercourse with a 15-year-old boy.
f 10 In August 2007, Rice abducted a former student (the same 10-year-old boy with whom she had sexual contact as a teacher) from his home without the consent of his parents and for the purpose of her own sexual gratification. Rice drove the 10-year-old boy to a rest stop and molested him.
II. PROCEDURAL HISTORY
f 11 On August 13, 2007, the Pierce County prosecuting attorney charged Rice with one count of kidnapping in the first degree, including a special allegation of sexual moti*891vation pursuant to former RCW 9.94A.835 (Laws of 2006, ch. 123, § 2), amended by Laws of 2009, ch. 28, § 15 (making insubstantial changes irrelevant to the issue presented here). On September 12, 2007, the prosecuting attorney filed an amended information charging 12 additional counts, including a count of child molestation in the first degree with a special allegation under RCW 9.94A.836 that the molestation was predatory. RCW 9.94A.030(38)(c)(i) (offense committed by a teacher against a student qualifies as predatory).
¶12 On May 16, 2008, Rice moved to dismiss the prosecutor’s special allegation that the child molestation was predatory, arguing in part that RCW 9.94A.836 “violates the separation of powers doctrine by curtailing the prosecutor’s charging discretion____” Clerk’s Papers (CP) at 10. On August 1, 2008, the trial court rejected that argument, noting that the legislature has authority “to prescribe the duties of prosecuting attorneys” and also noting that under the statute prosecutors retain discretion to decide whether to charge the underlying crime, to assess whether there is sufficient evidence to support a finding that the offense was predatory, and to evaluate whether such a supplemental charge would interfere with obtaining a conviction. CP at 47.
¶13 On April 20, 2009, the parties filed a stipulated agreement whereby Rice waived her right to a jury trial and stipulated to the facts described above. Rice also stipulated to a second amended information under which she was charged with (1) kidnapping in the first degree, with special allegations under RCW 9.94A.835 (sexual motivation) and RCW 9.94A.837 (victim under 15 years of age); (2) child molestation in the first degree, with a special allegation under RCW 9.94A.836 (offense was predatory); and (3) two counts of rape of a child in the third degree. The trial court accepted the stipulated agreement and found Rice guilty on all four counts, including the special allegations.
¶14 On July 24, 2009, Rice was sentenced. Under each of the enhanced counts — kidnapping and child molestation— *892Rice was sentenced as a sex offender to a mandatory minirmrm term of 25 years and a maximum term of life. Rice also was sentenced to 60 months of confinement for each count of rape of a child in the third degree, to be served concurrently.
f 15 Rice timely appealed her judgment and sentence, including the denial of her motion to dismiss. Before the Court of Appeals, Rice argued in part that RCW 9.94A.835, 836, and .837 all are mandatory charging statutes in violation of the separation of powers doctrine. The Pierce County prosecuting attorney, on behalf of the State, argued that the legislature has the power to limit the authority of prosecuting attorneys. The Court of Appeals rejected Rice’s argument, holding that the statutes do not unduly limit prosecutorial discretion because the prosecutor determines whether sufficient evidence exists and whether the supplemental charge would interfere with obtaining a conviction. Rice, 159 Wn. App. at 562-63.
f 16 Rice sought discretionary review of the separation of powers issue, Pet. for Review at 5, and we granted her petition, State v. Rice, 172 Wn.2d 1004, 258 P.3d 685 (2011). We have appellate jurisdiction under Const, aft. IV, § 4 and RAP 13.3.
III. STANDARD OF REVIEW
¶17 Issues of statutory construction and constitutionality are questions of law subject to de novo review. State v. Bradshaw, 152 Wn.2d 528, 531, 98 P.3d 1190 (2004).
IV. ANALYSIS
A. Standing
¶18 Rice has standing to challenge the legality of her enhanced sentence and specifically to challenge RCW 9.94A.835, .836, and .837 as unconstitutional. Rice was charged and convicted under those statutes, and “we regu*893larly consider constitutional challenges to criminal statutes in the prosecutions brought under them,” State v. Ruff, 122 Wn.2d 731, 734, 861 P.2d 1063 (1993), including challenges based on the separation of powers doctrine, see State v. Chavez, 163 Wn.2d 262, 273-74, 180 P.3d 1250 (2008); State v. Wadsworth, 139 Wn.2d 724, 991 P.2d 80 (2000); State v. Ammons, 105 Wn.2d 175, 179-82, 713 P.2d 719, 718 P.2d 796 (1986). Rice has standing to argue that the statutes under which she was charged interfere with the constitutional charging discretion of prosecuting attorneys.
B. Scope of Review
¶19 The constitutionality of all three charging statutes is properly before us. Rice directly challenged RCW 9.94A.836 before the trial court and appealed the trial court’s ruling on that issue. On appeal, based on the same constitutional argument rejected by the trial court, Rice then broadened her challenge to include all three charging statutes. We need not address the discrepancy because a “manifest error affecting a constitutional right” can be raised for the first time on appeal, RAP 2.5(a)(3); see State v. O’Hara, 167 Wn.2d 91, 98-99, 217 P.3d 756 (2009), and being charged, convicted, and sentenced pursuant to an unconstitutional charging statute qualifies as a manifest error affecting a constitutional right, see Ruff, 122 Wn.2d at 733 n.1; see also Wash. State Bar Ass’n v. State, 125 Wn.2d 901, 906, 890 P.2d 1047 (1995) (legislation in violation of separation of powers is unconstitutional and void). We thus consider whether the three challenged statutes are unconstitutional.
C. The Challenged Statutes
¶20 Each statute that Rice challenges authorizes the filing of a special allegation by a prosecuting attorney. For crimes other than sex offenses, RCW 9.94A.835(1) provides for the filing of a special allegation of sexual motivation:
The prosecuting attorney shall file a special allegation of sexual motivation in every criminal case, felony, gross misde*894meanor, or misdemeanor, other than sex offenses . . . when sufficient admissible evidence exists, which ... would justify a finding of sexual motivation by a reasonable and objective fact finder.
Similarly, RCW 9.94A.836(1) provides for the filing of a special allegation that a serious sex offense committed against a child was predatory:
In a prosecution for rape of a child in the first [or second] degree ... or child molestation in the first degree, the prosecuting attorney shall file a special allegation that the offense was predatory whenever sufficient admissible evidence exists, which . . . would justify a finding by a reasonable and objective fact finder that the offense was predatory, unless the prosecuting attorney determines, after consulting with a victim, that filing a special allegation under this section is likely to interfere with the ability to obtain a conviction.
Finally, for certain serious sex offenses (and kidnapping in the first degree with sexual motivation), RCW 9.94A.837(1) provides for the filing of a special allegation that the victim was under 15 years of age:
In a prosecution for rape in the first [or second] degree . . . indecent liberties by forcible compulsion, or kidnapping in the first degree with sexual motivation, the prosecuting attorney shall file a special allegation that the victim of the offense was under fifteen years of age at the time of the offense whenever sufficient admissible evidence exists, which ... would justify a finding by a reasonable and objective fact finder ... unless the prosecuting attorney determines, after consulting with a victim, that filing a special allegation under this section is likely to interfere with the ability to obtain a conviction.
¶21 These special allegations, if found to be true, impose heightened sentencing requirements. For certain crimes (including kidnapping in the first degree), a finding of sexual motivation requires that the defendant be sentenced as a sex offender. See former RCW 9.94A.712 (Laws of 2006, ch. 122, § 5), recodified as RCW 9.94A.507 (Laws of 2008, ch. 231, § 56). A defendant convicted of child molestation in the *895first degree also must be sentenced as a sex offender. See former RCW 9.94A.712(l)(a)(i) (2006). Sentencing a defendant as a sex offender requires imposition of a minimum term and maximum term, with the maximum term being the statutory maximum sentence for the given category of offense. See former RCW 9.94A.712(3)(a), (b) (2006); RCW 9A.20.021 (statutory máximums). The minimum term of a sex offender’s sentence normally must fall within the standard range for the particular type of offense. See former RCW 9.94A.712(3)(c)(i) (2006); RCW 9.94A.510 (standard ranges). However, if there is a special finding under RCW 9.94A.836 (that the offense was predatory) or under RCW 9.94A.837 (that the victim was under 15 years of age), the minimum term must be the high end of the standard range or 25 years, whichever is greater. See former RCW 9.94A-.712(3)(c)(ii) (2006). Under this indeterminate sentencing scheme, the convict is subject to community custody until the expiration of the maximum term, but may be released from confinement prior to that time, once the minimum term has been served. See former RCW 9.94A.712(5) (2006).
¶22 Rice was sentenced with special findings made under RCW 9.94A.835, .836, and .837. Because Rice was convicted of kidnapping in the first degree with a special finding of sexual motivation, she was sentenced as a sex offender for that count. And because of the special finding that her kidnapping victim was under 15 years of age, the minimum term imposed was 25 years. Likewise, because Rice was convicted of child molestation in the first degree, she was sentenced as a sex offender for that count; due to the special finding that the offense was predatory, the minimum term imposed was 25 years. Rice now challenges the charging statutes underlying her enhanced sentence.
D. Interpreting the Challenged Statutes
|23 The key issue in this case is whether the challenged statutes are directory or mandatory. Noncompli*896anee with a directory statute “ ‘is attended with no consequences,’ ” whereas violation of a mandatory statute “ ‘either invalidates purported transactions or subjects the noncomplier to affirmative legal liabilities.’ ” Niichel v. Lancaster, 97 Wn.2d 620, 623, 647 P.2d 1021 (1982) (quoting 1A C. Dallas Sands, Statutes and Statutory Construction § 25.03, at 298-99 (4th ed. 1972)). Rice assumes that the challenged statutes are mandatory and as a result argues that they are an unconstitutional encroachment upon the charging discretion of prosecuting attorneys. Such a legislative encroachment upon prosecutorial discretion would be unprecedented. If the statutes are directory, however, they only guide and do not limit the charging discretion of prosecuting attorneys. The charging statutes are mandatory only if a prosecuting attorney can be forced to comply or if a prosecutor’s failure to comply has legal repercussions. Otherwise, the statutes are directory only, “ ‘not intended by the legislature to be disregarded’ ” but serving “ ‘merely [as] a guide . . . rather than a limitation of power ....’”Id. at 623-24 (quoting 1A Sands, supra).
|24 The plain language of the challenged charging statutes alone does not resolve whether they are intended to be directory or mandatory. Each statute identifies certain conditions under which “the prosecuting attorney shall file” a special allegation. Although the word “shall” is presumptively mandatory, see, e.g., Singleton v. Frost, 108 Wn.2d 723, 728, 742 P.2d 1224 (1987), its meaning “is not gleaned from [use of] that word alone because our purpose is to ascertain legislative intent of the statute as a whole,” State v. Krall, 125 Wn.2d 146, 148, 881 P.2d 1040 (1994). This court recognized long ago that “[t]he words ‘may’ and ‘shall’ [are] used according to the context and intent found in the statute, and are frequently construed interchangeably.” Clancy v. McElroy, 30 Wash. 567, 568-69, 70 P. 1095 (1902); see also Niichel, 97 Wn.2d at 625, 627 (use of “shall” in specifying the timing of assessment procedures found to be directory); Spokane County ex rel. Sullivan v. Glover, 2 *897Wn.2d 162, 169, 97 P.2d 628 (1940) (“In our own tax code, the word ‘shall’ is used in almost every section, and it is apparent that it is employed indiscriminately in both the imperative and the permissive sense.”). In determining whether “shall” is mandatory, directory, or simply permissive in any given instance, we consider “ ‘all the terms and provisions of the act in relation to the subject of the legislation, the nature of the act, the general object to be accomplished and consequences that would result from construing the particular statute in one way or another.’ ” Krall, 125 Wn.2d at 148 (quoting State v. Huntzinger, 92 Wn.2d 128, 133, 594 P.2d 917 (1979)). The “prime consideration” remains “the intent of the legislature as reflected in its general, as well as its specific, legislation upon the particular subject.” Glover, 2 Wn.2d at 170.
¶25 In this case, we are convinced that the legislature intended the challenged charging statutes to be directory. We rely on the language of the statutes as a whole, related statutory provisions, and constitutional analysis in making this determination. We find that the presumption that “shall” is mandatory has been overcome in this instance. The charging statutes authorize certain special allegations and communicate legislative priority, without interfering with the inherent charging discretion of prosecuting attorneys. The charging statutes are thus directory and constitutional.
1. Statutory Language
¶26 The language of the charging statutes as a whole supports construing the statutes as directory. The statutes direct prosecuting attorneys to file particular special allegations if certain conditions are met, but the statutes do not provide for the enforcement of any supposed charging requirements, nor do the statutes identify any consequences if a prosecutor does not comply. This supports reading the statutes as directory only. See Donohoe v. Shearer, 53 Wn.2d 27, 32, 330 P.2d 316 (1958). Rice does not *898identify any legal consequences resulting from a prosecutor’s noncompliance with the charging statutes; she simply assumes that the statutes are mandatory and challenges them on that basis. Rice overlooks that the legislature sometimes intends to direct the actions of public officers, stating what they “shall” do in certain circumstances, without intending to impose any enforceable, legal obligations upon them. See Glover, 2 Wn.2d at 169-70; id. at 172 (finding use of “shall” merely directory regarding county treasurer’s giving of notice to property owners); RCW 9.94A.401 (“These standards are intended solely for the guidance of prosecutors . . . and may not be relied upon to create a right or benefit... enforceable at law by a party in litigation with the state.”). That the legislature did not identify any consequences resulting from a prosecutor’s noncompliance with the challenged charging statutes supports reading those statutes as directory.
2. Related Provisions
¶27 Related statutory provisions also support reading the challenged statutes as directory. In State v. Rowe, 93 Wn.2d 277, 609 P.2d 1348 (1980), we construed a prosecutor’s internal charging policy regarding a particular supplemental charge as directory — notwithstanding use of the word “shall” — in part because of a general provision “dealing] with exceptions applicable to any case.” 93 Wn.2d at 281-83 (emphasis omitted). The same reasoning applies here. The legislature has acknowledged by statute that prosecuting attorneys have broad charging discretion, notwithstanding seemingly mandatory filing language in the very same section. Compare RCW 9.94A.411(1) (acknowledging that a “prosecuting attorney may decline to prosecute, even though technically sufficient evidence to prosecute exists”), with RCW 9.94A.411(2)(a) (directing that “[c]rimes against persons will be filed if sufficient admissible evidence exists” (emphasis added)); see also State v. Korum, 157 Wn.2d 614, 626 n.3, 141 P.3d 13 (2006). The *899legislature’s acknowledgment of prosecutorial discretion is general and broad, including approval of the decision to forgo prosecution when a criminal statute is antiquated or when immunity must be given to one accused person in order to effectively prosecute another. See RCW 9.94A.411(l)(b), (h). This acknowledgment of discretion is intended generally “for the guidance of prosecutors,” including when they are deciding whether to file supplemental charges. RCW 9.94A-.401; see also Laws of 1983, ch. 115, §§ 14-17. Thus, although the legislature sometimes speaks in mandatory terms when authorizing the filing of certain criminal charges, that language is subject to the legislature’s own general and underlying acknowledgment of prosecutorial charging discretion. Here, the legislature has directed that the “prosecuting attorney shall file a special allegation of sexual motivation ... when sufficient admissible evidence exists,” RCW 9.94A-.835(1), but also has acknowledged that for various reasons the prosecutor still “may decline to prosecute, even though technically sufficient evidence to prosecute exists,” RCW 9.94A.411(1). The use of mandatory language in this context can be seen as a legislative expression of priority, meant to guide prosecuting attorneys but always subject to the prosecutor’s underlying charging discretion.
3. Constitutionality
f28 A directory reading of the challenged statutes is also supported by the fact that the statutes would be unconstitutional if they were mandatory. We presume “that the legislature intends to enact effective laws,” State v. Bryan, 93 Wn.2d 177, 183, 606 P.2d 1228 (1980), and insofar as possible “we construe statutes so as to preserve their constitutionality,” State v. Williams, 171 Wn.2d 474, 476, 251 P.3d 877 (2011). On numerous occasions, we have interpreted a statute to be directory or simply permissive, notwithstanding use of the word “shall,” when necessary to render the statute constitutional and when otherwise con*900sistent with legislative intent. See ZDI Gaming, Inc. v. State ex rel. Wash. State Gambling Comm’n, 173 Wn.2d 608, 619, 268 P.3d 929 (2012); Residents Opposed to Kittitas Turbines v. State Energy Facility Site Evaluation Council, 165 Wn.2d 275, 299, 197 P.3d 1153 (2008); In re Elliott, 74 Wn.2d 600, 607-10, 446 P.2d 347 (1968); State v. Sickles, 144 Wash. 236, 240-41, 257 P. 385 (1927). In Rowe, we construed the prosecutor’s internal charging policy as directory, notwithstanding use of the word “shall,” in part because a mandatory charging policy would have been unconstitutional. 93 Wn.2d at 283. The same reasoning applies here. Under the state constitution, a prosecuting attorney is a locally elected executive officer who has inherent authority to decide which available charges to file, if any, against a criminal defendant. The separation of powers doctrine thus precludes the legislature from requiring prosecuting attorneys to file any supplemental charges.
¶29 The separation of powers doctrine is “one of the cardinal and fundamental principles of the American constitutional system” and forms the basis of our state government. Wash. State Motorcycle Dealers Ass’n v. State, 111 Wn.2d 667, 674, 763 P.2d 442 (1988). Under Washington’s constitution, governmental authority is divided into three branches — legislative, executive, and judicial — and “[e]ach branch of government wields only the power it is given.” State v. Moreno, 147 Wn.2d 500, 505, 58 P.3d 265 (2002); see Const, arts. II (creating the “Legislative Department” to wield “legislative authority”), III (creating “The Executive” to wield “executive power”), IV (creating “The Judiciary” to wield “judicial power”). The branches are not “ ‘hermetically sealed,’ ” but “ ‘the fundamental functions of each branch remain inviolate,’ ” and a “ ‘multiplicity of checks and balances’ ” must be maintained. Hale v. Wellpinit Sch. Dist. No. 49, 165 Wn.2d 494, 503-04, 198 P.3d 1021 (2009) (emphasis added) (quoting Carrick v. Locke, 125 Wn.2d 129, 135, 882 P.2d 173 (1994) and State v. Evans, 154 Wn.2d 438, 445, 114 P.3d 627 (2005)). This constitutional division of government *901is “ ‘for the protection of individuals’ ” against centralized authority and abuses of power. Guillen v. Pierce County, 144 Wn.2d 696, 731, 31 P.3d 628 (2001) (quoting New York v. United States, 505 U.S. 144, 181, 112 S. Ct. 2408, 120 L. Ed. 2d 120 (1992)), rev’d on other grounds, 537 U.S. 129, 123 S. Ct. 720, 154 L. Ed. 2d 610 (2003); see also Hale, 165 Wn.2d at 504 (noting that the purpose of separation of powers is “to ensure liberty by defusing and limiting power”).
¶30 The division of governmental authority into separate branches is especially important within the criminal justice system, given the substantial liberty interests at stake and the need for numerous checks against corruption, abuses of power, and other injustices. Cf. State v. Pettitt, 93 Wn.2d 288, 294-95, 609 P.2d 1364 (1980) (noting that a prosecutor’s decision to file criminal charges entails “ ‘awesome consequences’ ” (quoting United States v. Lovasco, 431 U.S. 783, 794, 97 S. Ct. 2044, 52 L. Ed. 2d 752 (1977))). Separation of powers ensures that individuals are charged and punished as criminals only after a confluence of agreement among multiple governmental authorities, rather than upon the impulses of one central agency. First, legislative authority must be exercised to define crimes and sentences; second, executive power must be applied to collect evidence and seek an adjudication of guilt in a particular case; and third, judicial power must be exercised to confirm guilt and to impose an appropriate sentence. See State v. Case, 88 Wash. 664, 668, 153 P. 1070 (1915). The state constitution grants inherent powers to each separate branch to undertake these functions, including the distinct role of prosecuting attorneys within the executive branch.
¶31 A prosecuting attorney’s most fundamental role as both a local elected official and an executive officer is to decide whether to file criminal charges against an individual and, if so, which available charges to file. This “most important prosecutorial power” allows for the consideration of individual facts and circumstances when deciding whether to enforce criminal laws, and permits the prosecut*902ing attorney to seek individualized justice; to manage resource limitations; to prioritize competing investigations and prosecutions; to handle the modern “proliferation” of criminal statutes; and to reflect local values, problems, and priorities. Angela J. Davis, Arbitrary Justice: The Power of the American Prosecutor 12-14, 22 (2007); William T. Pizzi, Understanding Prosecutorial Discretion in the United States, 54 Ohio St. L.J. 1325, 1343-44 (1993); Norman Abrams, Prosecutorial Discretion, in 3 Encyclopedia of Crime and Justice 1272, 1274-75, 1276-77 (Sanford H. Kadish ed., 1983). For these reasons, a prosecutor’s inherent charging discretion necessarily is broader than a mere consideration of sufficiency of evidence and likelihood of conviction. See, e.g., Pettitt, 93 Wn.2d at 295; State v. Lewis, 115 Wn.2d 294, 299, 797 P.2d 1141 (1990); Abrams, supra, at 1275 (noting that although a prosecutor will consider these basic factors, “it is commonly accepted that the American prosecutor has complete discretion with respect to the selection of the charge”). For the same reasons, a prosecuting attorney’s charging discretion necessarily includes whether to charge an available special allegation — a decision that will depend upon the facts and circumstances of each case and the prosecutor’s own policies and priorities. Cf. United States v. LaBonte, 520 U.S. 751, 762, 117 S. Ct. 1673, 137 L. Ed. 2d 1001 (1997) (“Insofar as prosecutors ... determine whether a particular defendant will be subject to the enhanced statutory maximum, any such discretion would be similar to the discretion a prosecutor exercises when he decides what, if any, [underlying] charges to bring against a criminal suspect. Such discretion is an integral feature of the criminal justice system . . . .”). To hold otherwise would allow the legislature to limit the prosecutor’s discretion to the sole decision of whether to file any charges; the legislature then could require any such filing to include a draconian imposition of all (or the most severe) charges supported by available evidence. Our constitution affords prosecuting attorneys much more independent authority *903than that, including the authority to be merciful and to seek individualized justice.
¶32 To be sure, a prosecuting attorney’s exercise of charging discretion is not entirely unfettered. For example, a prosecutor must actually exercise individualized discretion in each case, see, e.g., Pettitt, 93 Wn.2d at 295-96, and each exercise of discretion must comport with constitutional requirements such as equal protection, see, e.g., State v. Talley, 122 Wn.2d 192, 214-15, 858 P.2d 217 (1993) (citing cases). Further, each charge filed must be authorized by the legislature. See State v. Lee, 87 Wn.2d 932, 934, 558 P.2d 236 (1976) (“The decision to prosecute must be based on the prosecutor’s ability to meet the proof required by the statute.”); Lewis, 115 Wn.2d at 305. The underlying discretion to select from available charges in each individual case remains with the prosecutor, however, and not with the legislature. Even critics acknowledge that prosecutorial charging discretion “is essential to the operation of our criminal justice system, despite the potential for abuse.” Davis, supra, at 12; see id. at 6 (“A system without discretion, in which police, judges, and prosecutors were not permitted to take into account the individual facts, circumstances, and characteristics of each case, would undoubtedly produce unjust results.”). Viable proposals for improving prosecutorial decision-making must focus on increasing transparency and educating voters, as well as preventing unconstitutional discrimination, see, e.g., id. at 180-94, but under the Washington State Constitution, legislative usurpation of prosecutorial charging discretion is not an available option.
¶33 On numerous occasions, we have acknowledged the “long-recognized” charging discretion of prosecuting attorneys, including discretion to determine the nature and number of available charges to file. Lewis, 115 Wn.2d at 299; see also, e.g., Korum, 157 Wn.2d at 625; State v. Moen, 150 Wn.2d 221, 227, 76 P.3d 721 (2003); Rowe, 93 Wn.2d at 287; Pettitt, 93 Wn.2d at 294; Case, 88 Wash. at 668. We *904now clarify that a prosecutor’s broad charging discretion is part of the inherent authority granted to prosecuting attorneys as executive officers under the Washington State Constitution.
¶34 The State argues that prosecuting attorneys have no inherent authority whatsoever because the legislature can “prescribe their duties” under article XI, section 5 of our constitution. That provision states that the legislature “shall provide for the election in the several counties of boards of county commissioners, sheriffs, county clerks, treasurers, and prosecuting attorneys . . . and shall prescribe their duties . . . .” Const, art. XI, § 5. As with many other provisions in Washington’s constitution, article XI, section 5 was borrowed from the constitution of another state. See The Journal of the Washington State Constitutional Convention 1889, at 718 & n.10 (Beverly Paulik Rosenow ed., 1999); see also Charles M. Gates, Foreword to The Journal of the Washington State Constitutional Convention 1889, supra, at v (“[T]he Washington convention furnished an excellent example of the tendency of American states to follow and copy one another in constitutional practices.”). The borrowed provision was the culmination of a nationwide trend toward locally elected officials, which “began about 1820 [when the] period of Jacksonian Democracy saw increased democratization of the American political process.” Joan E. Jacoby, The American Prosecutor: A Search for Identity 22 (1980); Abraham S. Goldstein, History of the Public Prosecutor, in 3 Encyclopedia of Crime and Justice, supra, at 1287. This important movement “strengthened the concept of a decentralized government . . . established greater independence for elected officials, and defined positions that required exercise of discretion.” Jacoby, supra, at 22. One such position was that of public prosecuting attorney, now a well-established creation of American law. See id. at xv, 4-6. By adopting article XI, section 5, and ensuring public enforcement of criminal laws by locally elected officials, the people of Washington provided ac*905countability to local communities and further diffused governmental power.
¶35 The State ignores that under article XI, section 5, the very concept of a locally elected “prosecuting attorney” includes the core function of exercising broad charging discretion on behalf of the local community. Although the legislature can fashion the duties of prosecuting attorneys, the legislature cannot interfere with the core functions that make them “prosecuting attorneys” in the first place. See State ex rel. Johnston v. Melton, 192 Wash. 379, 388, 73 P.2d 1334 (1937) (“In naming the county officers in § 5, Article 11 of the constitution, the people intended that those officers should exercise the powers and perform the duties then recognized as appertaining to the respective offices which they were to hold.”); State ex rel. Hamilton v. Troy, 190 Wash. 483, 485-87, 68 P.2d 413 (1937) (legislature cannot change official title of prosecuting attorneys); Nelson v. Troy, 11 Wash. 435, 443, 39 P. 974 (1895) (noting that “the duties devolving upon a prosecuting attorney of a county are very dissimilar to those of the county coroner or assessor”). Without broad charging discretion, a prosecuting attorney would cease to be a “prosecuting attorney” as intended by the state constitution. This would be true even if some modicum of charging discretion remained. See Melton, 192 Wash. at 390 (“ ‘If these constitutional offices can be stripped of a portion of the inherent functions thereof, they can be stripped of all such functions . . . and the will of the framers of the constitution thereby thwarted.’ ” (quoting Ex parte Corliss, 16 N.D. 470, 475, 114 N.W. 962 (1907))). The legislature is free to establish statutory duties that do not interfere with core prosecutorial functions, see, e.g., Callahan v. Jones, 200 Wash. 241, 247, 93 P.2d 326 (1939) (upholding statutory limit on the private practice of law by prosecuting attorneys); Jacoby, supra, at xx (describing various potential duties of prosecuting attorneys beyond engaging in criminal litigation); RCW 36.27-.020 (establishing various duties of prosecuting attorneys), *906but the legislature cannot interfere with the fundamental and inherent charging discretion of prosecuting attorneys, including discretion over the filing of available special allegations.
¶36 The inherent charging discretion of prosecuting attorneys is fundamental and cannot be ceded to the legislative branch by consent. Although the Pierce County prosecuting attorney defends the statutes challenged in this case by arguing (in part) that the legislature has the authority to eliminate all meaningful prosecutorial discretion, any attempt by the legislature to do so would violate the separation of powers doctrine and article XI, section 5, notwithstanding the prosecutor’s apparent consent. See Troy, 190 Wash. at 487 (“While we are reluctant to thwart the wishes of the prosecuting attorneys who earnestly desire the proposed change, it is plainly our duty to hold that the legislature . . . had no power to make it . . . .”). Although a violation of the separation of powers doctrine “accrues directly to the branch invaded,” Carrick, 125 Wn.2d at 136 (emphasis added), the underlying purpose of the doctrine is “ ‘the protection of individuals’ ” Guillen, 144 Wn.2d at 731 (emphasis added) (quoting New York, 505 U.S. at 181). Thus, we have reasoned that the “ ‘division of power among the three branches is violated where one branch invades the territory of another, whether or not the encroached-upon branch approves the encroachment.’ ” Id. (emphasis omitted) (quoting New York, 505 U.S. at 181). Although “a long history of cooperation between the branches” in any given context might show that no violation has occurred, Carrick, 125 Wn.2d at 136, one branch cannot simply consent to a separation of powers violation by another branch. This is especially true regarding a fundamental executive power to be exercised by locally elected officials; such officials cannot cede their inherent authority in order to deflect accountability to voters or when otherwise convenient.
¶37 In sum, because of the open-ended nature of the challenged statutes, the legislature’s broad and underlying *907acknowledgment of prosecutorial charging discretion, and the unconstitutionality of mandatory charging statutes, we are confident that in enacting RCW 9.94A.835, .836, and .837, the legislature had no intention of imposing enforceable charging requirements on prosecuting attorneys. Authorizing the special allegations and directing prosecuting attorneys to file them has furthered the legislature’s goal of punishing and deterring sexually motivated crimes, even though the authorized charges remain subject to prosecutorial discretion and are not mandatory. An executive officer must never file a special allegation based solely on the presence of legislatively defined, factual elements and without any exercise of discretion. Such a practice undoubtedly would produce unjust results, which the legislature would not intend. Because we construe the charging statutes as directory, Rice’s challenge fails.1
V. CONCLUSION
¶38 We hold that RCW 9.94A.835, .836, and .837 are directory charging statutes that do not violate the separa*908tion of powers doctrine. We thus affirm the Court of Appeals in result and uphold Rice’s conviction and sentence.
Madsen, C.J., and C. Johnson, Chambers, Owens, Fairhurst, J.M. Johnson, Stephens, and Wiggins, JJ., concur.Reconsideration denied November 2, 2012.
Rice challenges only RCW 9.94A.835, .836, and .837 as unconstitutional; she does not allege that the prosecutor in this case actually failed to exercise discretion. Cf. Pettitt, 93 Wn.2d at 296 (use of a “fixed formula” held “an abuse of the discretionary power lodged in the prosecuting attorney”). As the State points out, the record shows that the prosecutor probably did exercise discretion in this case. For example, both the original information and the first amended information charged Rice with kidnapping in the first degree and also with a special allegation of sexual motivation pursuant to RCW 9.94A.835. Although both documents provided the birthdate of Rice’s kidnapping victim, and thus established that Rice’s victim was under 15 years of age, neither information included a special allegation under RCW 9.94A.837. It was not until the parties submitted a second amended information as part of their plea agreement that Rice was charged under RCW 9.94A.837. There is no evidence that the prosecutor initially omitted this special allegation because of concerns about obtaining a conviction. Instead, the only communication in the record regarding the plea agreement shows that the prosecutor was concerned with ensuring sufficient time would be served and, in exchange, granted Rice the ability to challenge the charging statutes as unconstitutional. CP at 58-59. The prosecutor apparently exercised discretion in charging the special allegations in this case, and Rice does not argue otherwise.