*64This appeal arises out of the subprime mortgage crisis, a nationwide banking emergency that began in 2007 with the collapse of a housing financing bubble created in large part by an increase in housing speculation and subprime lending practices. This crisis led to a deep recession in the United States and around the globe. California was hit particularly hard. While the recession ended in mid-2009, at least as a definitional matter, persistent high unemployment continued throughout 2012, along with the continuing decline in home values, increase in foreclosures and personal bankruptcies, and the concomitant decrease in state revenue.
In March 2012, the federal government and the attorneys general of 49 states and *418the District of Columbia (every state except Oklahoma) brought suit in federal court against the nation's five largest mortgage servicers, i.e., Ally (formerly GMAC), Bank of America, Citigroup, J.P. Morgan Chase, and Wells Fargo (collectively, Bank defendants), alleging a number of violations of federal law. The case was resolved by settlement agreement (the National Mortgage Settlement or NMS), the terms of which the federal court formally entered as consent judgments in April 2012. In addition to setting comprehensive new mortgage servicing standards and providing more than $20 billion in financial relief for homeowners damaged by the mortgage crisis, the NMS also provided for about $2.5 billion to be paid to the states directly, "which *65sum shall be distributed in the manner and for the purposes specified in Exhibit B" to the agreement. Exhibit B states that "[e]ach State Attorney General shall designate the uses of the funds" and requires, "[t]o the extent practicable, such funds shall be used for purposes intended to avoid preventable foreclosures, to ameliorate the effects of the foreclosure crisis, to enhance law enforcement efforts to prevent and prosecute financial fraud, or unfair or deceptive acts or practices and to compensate the States for costs resulting from the alleged unlawful conduct of [the Bank defendants]."
California's share of this $2.5 billion direct payment was about $410 million. In Exhibit B-2 to the NMS, former Attorney General Kamala Harris provided fairly detailed instructions as to how these funds should be used. We describe these instructions later in the opinion.
After the consent judgments were entered, the Legislature enacted Government Code 1 section 12531, creating a special deposit fund in the treasury (the NMS Deposit Fund) where 90 percent of the $410 million amount would be deposited.
Pursuant to this procedure, the Director of Finance received approval for various expenditures from the NMS Deposit Fund "to offset General Fund costs of programs that support public protection, consumer fraud enforcement and litigation, and housing related programs" during the specified fiscal years. We set forth the details of these expenditures later in the opinion. For present purposes, we note they nearly exhausted the NMS Deposit Fund.
*419In March 2014, the National Asian American Coalition, COR Community Development Corporation, and the National Hispanic Christian Leadership *66Conference filed a petition for writ of mandate and complaint for declaratory and injunctive relief against the Governor, the Director of Finance, and the Controller, seeking the immediate return of approximately $350 million they alleged was unlawfully diverted from the NMS Deposit Fund to the General Fund in contravention of both section 12531 and the federal consent judgments.
The trial court concluded section 12531 was intended to effectuate the terms of the federal consent judgments, which required compliance with the instructions provided by former Attorney General Harris in Exhibit B-2 to the National Mortgage Settlement designating the permissible uses of the $410 million direct payment. Rejecting defendants' contention subdivision (e) of that section permitted the Director of Finance to use the NMS Deposit Fund to offset General Fund expenditures regardless of whether such offsets were consistent with these instructions, the trial court reasoned such a reading of the statute would "raise serious doubts about the legality of the statute, not only as to whether the Legislature may override a federal judgment, but also whether the Legislature constitutionally may delegate to an agency the authority to decide how millions of dollars of state funds shall be spent with virtually no guidance or direction from the Legislature." Turning to the question of whether the particular offsets were consistent with the former Attorney General's instructions, the trial court concluded $331,044,084 was unlawfully appropriated from the NMS Deposit Fund for purposes inconsistent with these instructions. Nevertheless, pointing out that it lacked the constitutional authority to order the Legislature to appropriate funds, the trial court declared an obligation to restore the unlawfully diverted funds and ordered such restoration "as soon as there is a sufficient appropriation 'reasonably' and 'generally' available for such purpose."
These appeals followed. Defendants contend: (1) plaintiffs lack standing to seek a writ of mandate directing the NMS Deposit Fund to be reimbursed for the challenged expenditures; (2) section 12531 does not restrict the Director of Finance's ability to use the NMS Deposit Fund to offset General Fund expenditures, aside from requiring Legislative approval of such offsets; (3) the Legislature possessed absolute authority to approve the challenged expenditures regardless of whether they were consistent with the federal consent judgments; and (4) even if section 12531 required consistency with the federal consent judgments, the challenged expenditures were consistent with both the purposes of the direct payment set forth in Exhibit B to the National *67Mortgage Settlement and the former Attorney General's instructions set forth in Exhibit B-2. Plaintiffs dispute each of these contentions and, in their appeal, contend: (1) the amount unlawfully diverted from the NMS Deposit Fund was actually $350 million; and (2) the trial court erred in concluding separation of powers principles prevented it from ordering *420the immediate restoration of the unlawfully diverted funds.
We conclude plaintiffs have public interest standing to seek the requested writ of mandate. We also conclude, as did the trial court, section 12531 was intended by our Legislature to effectuate the terms of the National Mortgage Settlement, including the former Attorney General's instructions regarding the proper uses of the money. The trial court also correctly concluded over $331 million was unlawfully appropriated from the NMS Deposit Fund for purposes inconsistent with the NMS. Where we part ways with the trial court is the issue of remedy. As we explain, because the unlawfully diverted funds are "in law still in the [NMS Deposit Fund]" ( Daugherty v. Riley (1934)
ADDITIONAL BACKGROUND
Having already provided a description of the events giving rise to this appeal in order to provide context for the parties' contentions and our resolution thereof, we shall not repeat ourselves here. Rather, we elaborate on those portions of context deliberately omitted above. Specifically, we shall provide (1) a fuller description of the terms of the National Mortgage Settlement, including the former Attorney General's instructions for use of the $410 million direct payment amount, (2) the complete text of section 12531, creating the NMS Deposit Fund and authorizing disbursements to offset General Fund expenditures, and (3) the details of the challenged disbursements made from the NMS Deposit Fund.
The National Mortgage Settlement
The stated purpose of the National Mortgage Settlement "is to remediate harms allegedly resulting from the alleged unlawful conduct of the [Bank defendants.]" The portion of the NMS relevant to these appeals provided for about $2.5 billion to be paid directly to the states. As mentioned, the agreement provided this amount "shall be distributed in the manner and for the purposes specified in Exhibit B."
*68Paragraph 1 of Exhibit B provides in relevant part:
"b. State Payment Settlement Amounts . In accordance with written instructions from each State Attorney General, the Escrow Agent shall distribute cash payments in the total amounts set forth in the attached Exhibit B-1.[
"i. Each State Attorney General shall designate the uses of the funds set forth in the attached Exhibit B-1. To the extent practicable, such funds shall be used for purposes intended to avoid preventable foreclosures, to ameliorate the effects of the foreclosure crisis, to enhance law enforcement efforts to prevent and prosecute financial fraud, or unfair or deceptive acts or practices and to compensate the States for costs resulting from the alleged unlawful conduct of [the Bank defendants]. Such permissible purposes for allocation of the funds include, but are not limited to, supplementing the amounts paid to state *421homeowners under the Borrower Payment Fund,[
"ii. No more than ten percent of the aggregate amount paid to the State Parties under this paragraph 1(b) may be designated as a civil penalty, fine, or similar payment. The remainder of the payment[ ] is intended to remediate the harms to the States and their communities resulting from the alleged unlawful conduct of the [Bank defendants] and to facilitate the implementation of the Borrower Payment Fund and consumer relief."
In Exhibit B-2, former Attorney General Harris provided the following general instructions:
"a) Ten percent of the payment shall be paid as a civil penalty and deposited in the Unfair Competition Law Fund;
"b) The remainder shall be paid and deposited into a Special Deposit Fund created for the following purposes: for the administration of the terms of this Consent Judgment; monitoring compliance with the terms of this Consent *69Judgment and enforcing the terms of this Consent Judgment; assisting in the implementation of the relief programs and servicing standards as described in this Consent Judgment; supporting the Attorney General's continuing investigation into misconduct in the origination, servicing, and securitization of residential mortgage loans; to fund consumer fraud education, investigations, enforcement operations, litigation, public protection and/or local consumer aid; to provide borrower relief; to fund grant programs to assist housing counselors or other legal aid agencies that represent homeowners, former homeowners, or renters in housing-related matters; to fund other matters, including grant programs, for the benefit of California homeowners affected by the mortgage/foreclosure crisis; or to engage and pay for third parties to develop or administer any of the programs or efforts described above."
Creation of the NMS Deposit Fund
After the federal court approved the National Mortgage Settlement and entered consent judgments incorporating its terms, the State Department of Finance submitted a letter (Finance letter) to the Senate Budget and Fiscal Review Committee requesting, among other things, trailer bill language authorizing "the Director of Finance to allocate funds received pursuant to the [NMS]" and creating a special fund where these settlement funds would be deposited. The Finance letter states: "For 2011-12 and 2012-13, $94.2 million of the [direct payment amount] will be used to offset General Fund costs of programs that support public protection, consumer fraud enforcement and litigation, and housing related programs. An additional $198 million will be used for debt service payments for programs funded with Proposition 46 and Proposition 1C housing bonds that assist homeowners. The remaining $118.4 million will be reserved for similar *422use in 2013-14."
About six weeks later, the Legislature enacted section 12531 as part of a trailer bill to the 2012 Budget Act. This section provides in full:
"(a) The Legislature finds and declares that California, represented by the California Attorney General, entered a national multistate settlement with the country's five largest loan servicers. This agreement, the National Mortgage *70Settlement stemmed from successful resolution of federal court action (Consent Judgment, United States v. Bank of America (No. 1:12-cv-00361, Banzr. D.C. Apr. 4, 2012). The National Mortgage Settlement is broad ranging, with California's share of this settlement estimated to be up to eighteen billion dollars ($18,000,000,000). Of this amount, approximately four hundred ten million dollars ($410,000,000) will come directly to the state in costs, fees, and penalty payments.
"(b) There is hereby created in the State Treasury the National Mortgage Special Deposit Fund. Notwithstanding Section 13340, all moneys in the fund are hereby continuously appropriated, and shall be allocated by the Department of Finance.
"(c) Direct payments made to the State of California as civil penalties pursuant to the National Mortgage Settlement shall be deposited in the Unfair Competition Law Fund as required by the settlement.
"(d) Direct payments made to the State of California pursuant to the National Mortgage Settlement, except for those payments made pursuant to subdivision (c), shall be deposited in the National Mortgage Special Deposit Fund.
"(e) Notwithstanding any other law, the Director of Finance may allocate or otherwise use the funds in the National Mortgage Special Deposit Fund to offset General Fund expenditures in the 2011-12, 2012-13, and 2013-14 fiscal years. The Department of Finance and the Controller's office shall recognize this fiscal alignment accordingly for the purpose of the state budget process and legal basis of accounting.
"(f) Not less than 30 days prior to allocating any moneys pursuant to subdivision (e), the Department of Finance shall submit an expenditure plan to the Joint Legislative Budget Committee detailing the proposed use of the moneys in the National Mortgage Special Deposit Fund.
"(g) Notwithstanding any other law, the Controller may use the funds in the National Mortgage Special Deposit Fund for cashflow loans to the General Fund as provided in Sections 16310 and 16381." ( § 12531.)
Disbursements from the NMS Deposit Fund
About two months after the NMS Deposit Fund was created, the escrow agent wired the entirety of California's direct payment into the state's Litigation Deposits *423Fund. Thereafter, pursuant to section 12531, 10 percent of *71that amount was redirected into the Unfair Competition Law Fund and 90 percent was redirected into the NMS Deposit Fund.
Before setting forth the details of the challenged disbursements, we briefly note those that are not challenged. Consistent with section 12531, subdivision (g), the 2012 Budget Act authorized a $100 million loan from the NMS Deposit Fund to the General Fund to be repaid by June 30, 2014. Such a loan was made on September 24, 2012 and repaid with interest on April 11, 2014. The 2012 Budget Act also appropriated about $18 million from the NMS Deposit Fund to the State Department of Justice, $8 million of which was appropriated to support the Office of the California Monitor, who assists the Attorney General in ensuring the Bank defendants comply with the terms of the NMS, and the remaining $10 million was appropriated for grants to assist homeowners affected by the foreclosure crisis. These disbursements are clearly consistent with the former Attorney General's general instructions for use of the funds and are not challenged in these appeals.
The challenged disbursements total about $350 million. The expenditure plan submitted by the Department of Finance pursuant to section 12531, subdivision (f), proposed the following offsets:
"General Fund debt service payments for Propositions 1C and 46 Housing Bonds will be offset by [$292.4 million, i.e.,] $106 million, $92 million, and $94.4 million in 2011-12, 2012-13, and 2013-14[,] respectively."
"The Department of Justice's (DOJ's) General Fund expenditures will be offset by [$49.2 million, i.e.,] $14.9 million, $17.8 million, and $16.5 million in 2011-12, 2012-13, and 2013-14[,] respectively."
"The Department of Fair Employment and Housing's General Fund expenditures will be offset by [$9 million, i.e.,] $3 million in 2011-12, 2012-13, and 2013-14[,] respectively."
While the State Department of Finance did not receive a response to this expenditure plan, that department's Final Change Book for the 2012-13 Budget indicates the Legislature accepted the request made in the Finance letter that preceded enactment of section 12531, i.e., that the direct payment would be used to offset General Fund costs of programs that support public protection, consumer fraud enforcement and litigation, and housing related programs. Various executive orders executed the offsets proposed in the expenditure plan, with minor alterations to the amounts.
*72DISCUSSION
I
Standard of Review
Plaintiffs sought a writ of mandate from the trial court, as well as declaratory and injunctive relief, compelling defendants to return the $350 million they claim was unlawfully diverted from the NMS Deposit Fund. "A writ of mandate 'may be issued by any court ... to compel the performance of an act which the law specially enjoins, as a duty resulting from an office, trust, or station ....' ( Code Civ. Proc., § 1085, subd. (a).)" ( *424Kavanaugh v. West Sonoma County Union High School Dist. (2003)
On appeal, we defer to the trial court's factual determinations if supported by substantial evidence. However, as always, we review questions of law de novo. ( Kavanaugh v. West Sonoma County Union High School Dist. , supra , 29 Cal.4th at p. 916,
II
Standing
Defendants contend plaintiffs "cannot enforce the consent judgments under federal law, and lack standing to bring their claims under California law."
*73While we agree the individual homeowners plaintiffs seek to assist in staying in their homes " 'are merely incidental beneficiaries of the National Mortgage Settlement,' " and therefore have "no standing to enforce the consent judgment[s]" ( Graham v. Bank of America, N.A. (2014)
The law governing standing to seek a writ of mandate is well-settled. "As a general rule, a party must be 'beneficially interested' to seek a writ of mandate. ( Code Civ. Proc., § 1086.) 'The requirement that a petitioner be "beneficially interested" has been generally interpreted to mean that one may obtain the writ only if the person has some special interest to be served or some particular right to be preserved or protected over and above the interest held in common with the public at large. ... The beneficial interest must be direct and substantial. [Citations.]' " ( Save the Plastic Bag Coalition v. City of Manhattan Beach (2011)
However, " 'where the question is one of public right and the object of the mandamus is to procure the enforcement of a public duty, the [petitioner] need not show that he [or she] has any legal or special interest in the result, since it is sufficient that [the petitioner] is interested as a citizen in having the laws executed and the duty in question enforced.' " ( Board of Social Welfare v. Los Angeles County (1945)
Here, the trial court concluded plaintiffs did not have beneficial interest standing, explaining they "have no direct interest in the legal duty sought to be compelled and will gain no direct benefit from its performance." However, the trial court also concluded plaintiffs fell within the "well-established 'public interest' exception to the beneficial interest requirement." Because we agree with the latter conclusion, we need not consider the former.
As we explained in Shaw v. People ex rel. Chiang (2009)
Nevertheless, defendants argue, "the public interest exception should not apply" in this case because "the alleged interest is 'outweighed ... by competing considerations of a more urgent nature,' " and cite this court's decision in Sacramento County Fire Protection Dist. v. Sacramento County Assessment Appeals Bd. (1999)
Defendants argue, "[s]imilar risks arise here" because providing plaintiffs with standing in this case allows them to "override" provisions in the National Mortgage Settlement that "excluded third-parties like [them] from the list of parties who could bring enforcement proceedings" and "threatens to undermine the State's ability to enter into future settlement agreements that seek to bring finality to the State and other litigants." Not so. This is not a *75suit to enforce the NMS. It is an action in mandamus to compel defendants to return to the NMS Deposit Fund money plaintiffs claim was misappropriated in contravention of section 12531. As we have explained, there is a sharp duty to comply with restrictions placed on the expenditure of public funds and a weighty public need for enforcement of such restrictions. Providing plaintiffs with standing in this case does nothing to undermine California's ability to enter into settlement agreements.
III
Proper Interpretation of Section 12531
We now turn to defendants' contention the trial court misconstrued section 12531. The trial court concluded section 12531 was intended to effectuate the terms of the federal consent judgments, which required compliance with the instructions provided by former Attorney General Harris in Exhibit B-2 to the National Mortgage Settlement designating the permissible uses of the $410 million direct payment. Rejecting defendants' contention subdivision (e) of that section permitted the Director of Finance to use the NMS Deposit Fund to offset General Fund expenditures regardless of whether such offsets were consistent with these instructions, the trial court reasoned such a reading of the statute would "raise serious doubts about the legality of the statute, not only as to whether the Legislature may override a federal judgment, but also whether the Legislature constitutionally may delegate to an agency the authority to decide how millions of dollars of state funds shall be spent with virtually no guidance or direction from the Legislature."
Defendants assert this interpretation of section 12531 runs "[c]ontrary to the plain meaning of the statute" and argues the plain meaning of subdivision (e) of that section "gives the Director of Finance discretion to 'allocate or otherwise use the funds' in the [NMS Deposit Fund] 'to offset General Fund expenditures' in three fiscal years, '[n]otwithstanding any other law.' It places no restriction on the type of General Fund expenditures that the funds can be used to offset, let alone the kinds of restrictions that the trial court erroneously found in the [former] Attorney General's instructions." We agree with the trial court's interpretation of the section.
"Pursuant to established principles, our first task in construing a statute is to ascertain the intent of the Legislature so as to effectuate the purpose of the law. In determining such intent, a court must look first to the words of the statute themselves, giving to the language its usual, ordinary import and according significance, if possible, to every word, phrase and sentence in pursuance of the legislative purpose. A construction making some words surplusage is to be avoided. The words of the statute must be *76construed in context, keeping in mind the *427statutory purpose, and statutes or statutory sections relating to the same subject must be harmonized, both internally and with each other, to the extent possible. [Citations.] Where uncertainty exists consideration should be given to the consequences that will flow from a particular interpretation. [Citation.] Both the legislative history of the statute and the wider historical circumstances of its enactment may be considered in ascertaining the legislative intent. [Citations.] A statute should be construed whenever possible so as to preserve its constitutionality. [Citations.]" ( Dyna-Med, Inc. v. Fair Employment & Housing Com. (1987)
We conclude section 12531 was intended to effectuate the terms of the National Mortgage Settlement. As previously stated, subdivision (a) of this section provides: "The Legislature finds and declares that California, represented by the California Attorney General, entered a national multistate settlement with the country's five largest loan servicers. This agreement, the National Mortgage Settlement stemmed from successful resolution of federal court action (Consent Judgment, United States v. Bank of America (No. 1:12-cv-00361, Banzr. D.C. Apr. 4, 2012). The National Mortgage Settlement is broad ranging, with California's share of this settlement estimated to be up to eighteen billion dollars ($18,000,000,000). Of this amount, approximately four hundred ten million dollars ($410,000,000) will come directly to the state in costs, fees, and penalty payments." ( § 12531, subd. (a).) Then subdivision (b) creates the NMS Deposit Fund, continuously appropriates all moneys in the fund, and directs the State Department of Finance to allocate the money. (Id ., subd. (b).) Subdivisions (c) and (d) direct where the settlement disbursement shall be deposited, 90 percent going into the NMS Deposit Fund. (Id ., subds. (c) & (d).) Subdivision (e) then provides: "Notwithstanding any other law, the Director of Finance may allocate or otherwise use the funds in the [NMS] Deposit Fund to offset General Fund expenditures in the 2011-12, 2012-13, and 2013-14 fiscal years. The Department of Finance and the Controller's office shall recognize this fiscal alignment accordingly for the purpose of the state budget process and legal basis of accounting." (Id ., subd. (e).)
Because subdivision (a) makes reference to the former Attorney General's successful negotiation of the National Mortgage Settlement, and subdivisions (b) through (d) effectuate California's receipt of the settlement proceeds as set forth in the former Attorney General's instructions, i.e., 10 percent to the Unfair Competition Law Fund and 90 percent into a special deposit fund (the NMS Deposit Fund), and because the purpose of creating a special deposit fund is to house money that is "collected or received for specific purposes" (§ 16372), it is only reasonable to conclude the Legislature intended the specific purposes set forth in the former Attorney General's instructions are also the purposes for which the NMS Deposit Fund money may be spent.
*77Nevertheless, defendants claim the Legislature intended to allow the Director of Finance to disregard the former Attorney General's instructions and use the money in the NMS Deposit Fund to offset any General Fund expenditures. This supposed intent, they argue, may be found in the phrase "[n]otwithstanding any other law" in subdivision (e), before that subdivision directs the Director of Finance to "offset General Fund expenditures in the 2011-12, 2012-13, and 2013-14 fiscal years." ( § 12531, subd. (e).) We are not persuaded that this phrase was intended to untether the offsets from the purposes for which the *428money was received. Indeed, defendants' reading of the statute would effectively defeat the purpose of creating a special deposit fund to house the money. Moreover, the fact that the Legislature intended the NMS Deposit Fund to be a special deposit fund with restrictions on the use of the money housed therein is also supported by subdivision (g), which allows for "cashflow loans to the General Fund as provided in Sections 16310 and 16381." (Id ., subd. (g).) Sections 16310 and 16381 allow for such loans from special deposit funds when the General Fund is or will be exhausted.
Our reading of the statute, and that of the trial court, is also bolstered by the legislative history. The Legislative Counsel's Digest for section 12531 states: "This bill would establish the [NMS] Deposit Fund in the State Treasury as a continuously appropriated fund and would require certain direct payments made to the state under the National Mortgage Settlement to be deposited in the fund for allocation by the Director of Finance, as specified. This bill would further authorize the Director of Finance to allocate moneys from the fund to offset General Fund expenditures during the 2011-12, 2012-13, and 2013-14 fiscal years for purposes consistent with the National Mortgage Settlement ." (Legis. Counsel's Dig., Sen. Bill No. 1006, (2011-2012 Reg. Sess.) Stats. 2012, ch. 32, § 12, italics added < http://www.leginfo.ca.gov/pub/11-12/bill/sen/sb_1001-1050/sb_1006_bill_20120625_amended_asm_v98.html> [as of July 5, 2018], archived at < https://perma.cc/BPZ8-CS45>.) The former Attorney General's general instructions for use of the settlement money is part of the NMS.
Finally, we also agree with the trial court's conclusion defendants' reading of the statute would "raise serious doubts about the legality of the statute, not only as to whether the Legislature may override a federal judgment, but also whether the Legislature constitutionally may delegate to an agency the authority to decide how millions of dollars of state funds shall be spent with virtually no guidance or direction from the Legislature." Defendants address the first of these concerns by arguing the Legislature has plenary power over appropriations that includes the authority to override an Attorney General's settlement agreement as long as doing so does not interfere with a party's vested rights (primarily relying on Van de Kamp v. Gumbiner (1990)
*78has been incorporated into a federal judgment, such a judgment may not contravene an otherwise valid state law unless necessary to vindicate a federal right (primarily relying on Washington v. Penwell (9th Cir. 1983)
We need not decide these potential constitutional issues because our reading of section 12531, supported by the language of the statute and its legislative history, avoids them entirely. "When faced with a statute reasonably susceptible of two or more interpretations, of which at least one raises constitutional questions, we should construe it in a manner that avoids any doubt about its validity." ( *429Association for Retarded Citizens v. Department of Developmental Services (1985)
IV
Consistency with the National Mortgage Settlement
We now turn to the question of whether the offsets carried out by the Director of Finance are consistent with the National Mortgage Settlement. As mentioned, the trial court concluded over $331 million was unlawfully diverted from the NMS Deposit Fund for purposes inconsistent with the NMS, specifically the former Attorney General's general instructions set forth in Exhibit B-2 thereto. Defendants argue these expenditures were consistent with both the purposes of the direct payment set forth in Exhibit B to the NMS and the former Attorney General's instructions. In their appeal, plaintiffs contend the amount unlawfully diverted from the NMS Deposit Fund was actually $350 million. We again agree with the trial court's assessment.
As a preliminary matter, we reject defendants' assertion that consistency with the purposes set forth in Exhibit B would suffice to authorize the expenditures even if those expenditures were contrary to the former Attorney General's instructions. The NMS provided that the direct payment amount "shall be distributed in the manner and for the purposes specified in Exhibit B." Paragraph 1 of Exhibit B provides that "[e]ach State Attorney General shall designate the uses of the funds" and then states: "To the extent practicable, such funds shall be used for purposes intended to avoid preventable foreclosures, to ameliorate the effects of the foreclosure crisis, to *79enhance law enforcement efforts to prevent and prosecute financial fraud, or unfair or deceptive acts or practices and to compensate the States for costs resulting from the alleged unlawful conduct of [the Bank defendants]. Such permissible purposes for allocation of the funds include, but are not limited to, supplementing the amounts paid to state homeowners under the Borrower Payment Fund, funding for housing counselors, state and local foreclosure assistance hotlines, state and local foreclosure mediation programs, legal assistance, housing remediation and anti-blight projects, funding for training and staffing of financial fraud or consumer protection enforcement efforts, and civil penalties. Accordingly, each Attorney General has set forth general instructions for the funds in the attached Exhibit B-2 ." (Italics added.) Thus, while Exhibit B provides general permissible purposes for use of the direct payment, it expressly incorporates the more specific instructions provided by the former Attorney General in Exhibit B-2. Because, as we have concluded, section 12531 was intended to effectuate the NMS, the offsets made by the Director of Finance must be consistent with the former Attorney General's instructions.
These instructions provide: "The remainder [i.e., 90 percent of the direct payment] shall be paid and deposited into a Special Deposit Fund created for the following purposes: for the administration of the terms of this Consent Judgment; monitoring compliance with the terms of this Consent Judgment and enforcing the terms of this Consent Judgment; assisting in the implementation of the relief programs and servicing standards as described in this Consent Judgment; supporting the Attorney General's continuing investigation into misconduct in the origination, servicing, and securitization of residential mortgage loans; to fund consumer fraud education, investigations, enforcement operations, litigation, public protection and/or local consumer aid; to provide *430borrower relief; to fund grant programs to assist housing counselors or other legal aid agencies that represent homeowners, former homeowners, or renters in housing-related matters; to fund other matters, including grant programs, for the benefit of California homeowners affected by the mortgage/foreclosure crisis; or to engage and pay for third parties to develop or administer any of the programs or efforts described above."
Relying on our decision in Shaw , supra ,
We agreed with this determination, explaining: "There is a clear distinction between transferring revenue from the PTA to the General Fund to pay current debt obligations on mass transportation bonds and transferring such revenue to reimburse for past debt obligations. In the case of the former, the revenue flows from the source to the present obligation via the General Fund to serve a mass transportation purpose. Although the money passes through the General Fund, it is still actually being used for the identified mass transportation purpose. In the Legislature's discretion, this may include the payment of current bond debt on mass transportation bonds. In the case of offsets or reimbursement of past debt service payments, however, there is no mass transportation debt obligation to be paid with the PTA funds. The debt was paid by the General Fund in the prior fiscal years. No actual debt remains. Money from the PTA under the label of offsetting or reimbursing past debt payments is simply transferred to the General Fund where it can be used for any governmental purpose. Such reimbursement of the General Fund for its previous payment of its obligation on the specified bonds does not serve a 'mass transportation' purpose. There is no flow through similar to the payment of current debt." ( Shaw , supra , 175 Cal.App.4th at p. 610,
Applying this reasoning, the trial court in this case invalidated all transfers to the General Fund to offset debt service payments for housing bonds (totaling $292.7 million). The trial court also invalidated transfers made to the General Fund *431during the 2012-13 and 2013-14 fiscal years to offset DOJ and DFEH expenditures for the 2011-12 and 2012-13 fiscal years, (totaling $38.4 million), as those expenditures had also already been paid by the General Fund. We agree with this assessment. Nevertheless, defendants argue the fact that "the Legislature knew and understood how the Director of Finance intended to use the money" and did not "object is strong evidence that the plan complied with the Legislature's intent in enacting section 12531." We are not persuaded. While this is evidence the Legislature may have believed the Director of Finance's proposed offsets were consistent *81with section 12531 and the NMS, "this belief is not binding on a court. ... The interpretation of a statute or a [settlement agreement] ' "is an exercise of the judicial power the Constitution assigns to the courts." [Citation.]' [Citations.]" ( California School Boards Assn. v. State (2011)
The remaining $19.5 million was transferred from the NMS Deposit Fund to the General Fund during the 2013-14 fiscal year to pay certain DOJ and DFEH expenditures incurred that year. The trial court declined to invalidate these transfers concluding there was no evidence the obligations were already paid at the time of the transfers. In their appeal, plaintiffs claim these payments should also have been invalidated, arguing these offsets "rest upon an accounting fiction" and the fact that DOJ and DFEH "might have something to do with administering programs or enforcing regulations related to the purposes for which the [NMS Deposit] Fund was created is not sufficient" to comply with the former Attorney General's instructions. However, while DOJ and DFEH do more than investigate mortgage fraud and housing-related matters, respectively, the burden was on plaintiffs to show these specific expenditures went to other purposes. We agree with the trial court's conclusion they failed to carry that burden.
V
Appropriate Remedy
Finally, we address the question of the appropriate remedy. The trial court concluded principles of separation of powers prevented it from issuing a writ of mandate directing the Legislature to appropriate funds to restore the $331 million unlawfully diverted from the NMS Deposit Fund. Instead, the trial court declared an obligation to restore the unlawfully diverted funds and ordered such restoration "as soon as there is a sufficient appropriation 'reasonably' and 'generally' available for such purpose."
Plaintiffs do not dispute that directing an appropriation would violate the separation of powers. Instead, they argue: "The legal violations at issue in this case lie not in a failure to appropriate the requisite funds, but in a series of executive orders, issued by the Defendant Director of Finance to the Defendant Controller, that unlawfully transferred the funds that had already been appropriated. Accordingly, the appropriate remedial order would simply direct Defendants to rescind those transfers-or, equivalently, to transfer equal sums back from the General Fund to the [NMS] Deposit Fund." We agree.
" Article III, section 3 of the California Constitution provides that '[t]he powers of state government are legislative, executive, and judicial.
*82Persons charged with the exercise of one power may not exercise either of the others except as permitted by this Constitution.' Article XVI, section 7 provides that '[m]oney may be drawn from the Treasury only through an appropriation made by law and upon a Controller's duly drawn warrant.'
*432Article IV, sections 10 and 12 set forth the respective powers of the Legislature and Governor over the enactment of appropriations. It has long been clear that these separation-of-powers principles limit judicial authority over appropriations. [Citations.]" ( Butt v. State of California (1992)
For example, in Butt , supra ,
In reaching the latter conclusion, the court distinguished Mandel v. Myers (1981)
*83Returning to Butt , supra ,
The trial court's reliance on Butt, supra,
For these reasons, our case is more analogous to Daugherty , supra ,
Here, too, money was unlawfully diverted from a special fund in contravention of the purposes for which that special fund was established. Of course, Daugherty, supra, 1 Cal.2nd 298,
DISPOSITION
The portion of the judgment declining to issue the requested writ of mandate is reversed and the matter is remanded to the trial court with directions to issue a writ of mandate directing defendants, Edmund G. Brown Jr., Governor, Michael Cohen, Finance Director, and Betty Yee, Controller, to retransfer from the General Fund to the National Mortgage Settlement Deposit Fund the sum of $331,044,084. The parties shall bear their own costs on appeal. ( Cal. Rules of Court, rule 8.278(a)(5).)
We concur:
RAYE, P. J.
HULL, J.
As we explain in greater detail later, in accordance with former Attorney General Harris's instructions, 10 percent of the direct payment amount would be "paid as a civil penalty and deposited in the Unfair Competition Law Fund." (See § 12531, subd. (c) ["payments made to the State of California as civil penalties pursuant to the National Mortgage Settlement shall be deposited in the Unfair Competition Law Fund as required by the settlement"].)
Organizational plaintiffs are California-based charitable organizations that either provide counseling to homeowners seeking to avoid foreclosure or stand ready to do so should funding become available through replenishment of the NMS Deposit Fund.
Since both parties appealed from the trial court's judgment, we refer to National Asian American Coalition et al. as plaintiffs and Edmund G. Brown Jr. et al. as defendants.
Exhibit B-1 lists California's share of the state payment settlement amount as $410,576,996.
As mentioned, the vast majority of damages paid by the Bank defendants under the NMS, more than $20 billion, was designated to provide financial relief for individual borrowers. Exhibit C to the NMS set forth the details regarding administration of the distribution of cash payments to such borrowers.
Defendants ask this court to take judicial notice of the State Department of Housing and Community Development's record of Proposition 1C bond awards through December 31, 2013, explaining this government document was before the trial court and is part of the record on appeal, but the copy therein is "corrupt and illegible." Plaintiffs do not oppose this request, which we grant. (Evid. Code, § 452, subds. (c), (h).) We deny defendants' further request that we take judicial notice of a motion to vacate judgment and trial court order denying that motion in another case, Shaw v. Chiang , Sacramento County Superior Court Case No. 07CS01179. These materials are irrelevant to our resolution of the issues raised in this appeal. (See Towns v. Davidson (2007)
For example, whereas $94.4 million was proposed for offsetting General Fund debt service payments for Propositions 1C and 46 housing bonds in the 2013-14 fiscal year, the amount transferred for these purposes was actually $94.7 million. The precise total amount of challenged transfers is $350,360,084.
