
579 N.E.2d 1003 (1991)
219 Ill. App.3d 707
162 Ill.Dec. 189
The FIREMEN'S ANNUITY AND BENEFIT FUND OF THE CITY OF CHICAGO, Plaintiff-Appellant,
v.
The MUNICIPAL EMPLOYEES', OFFICERS', AND OFFICIALS' ANNUITY AND BENEFIT FUND OF CHICAGO, Defendant-Appellee.
No. 1-90-3324.
Appellate Court of Illinois, First District, Second Division.
September 10, 1991.
*1004 Fagel & Haber, Chicago (Maynard B. Russell, Steven J. Teplinsky and James A. Roth, of counsel), for plaintiff-appellant.
Frederick P. Heiss and William A. Marovitz, Chicago, for defendant-appellee.
Justice DiVITO delivered the opinion of the court:
Plaintiff Firemen's Annuity and Benefit Fund of Chicago (Firemen's Fund) brought suit against defendant Municipal Employees', Officers', and Officials' Annuity and Benefit Fund of Chicago (the Municipal Fund), alleging actions for unjust enrichment and imposition of a public trust. For relief, Firemen's Fund sought a transfer of the City of Chicago's (the City) contributions to the Municipal Fund to its pension fund. The Municipal Fund moved to dismiss the complaint and the circuit court granted its motion. Firemen's Fund appeals, raising in issue whether the circuit court erred in dismissing Firemen's Fund's complaint on the basis that the applicable statutes do not create a cause of action to compel the transfer of moneys and thus, the court did not have the judicial authority to order the transfer.
Firemen's Fund was created in accordance with the Firemen's Annuity and Benefit Fund Act (Firemen's Pension Act) (Ill. Rev.Stat.1989, ch. 108½, par. 6-101 et seq.) to provide for the payment of retirement and disability benefits to disabled and retired City firefighters and their beneficiaries. Likewise, the Municipal Fund was established in accordance with the Municipal Employees', Officers', and Officials' Annuity and Benefit Fund Act (Municipal Pension Act) (Ill.Rev.Stat.1989, ch. 108½, par. 8-101 et seq.) to provide similar benefits to retired and disabled City employees and their beneficiaries. Both Firemen's Fund and the Municipal Fund are supported through regular salary deductions from employees participating in the funds. In addition, the City provides matching contributions for each individual participant. It is these contributions which are at issue in the present case.
*1005 Prior to July 1, 1983, paramedics employed by the City were not considered "firemen" for purposes of inclusion in Firemen's Fund; rather, their pension contributions were paid into the Municipal Fund. (See Ill.Rev.Stat.1981, ch. 108½, par. 6-106(a).) A statutory amendment, which became effective on September 24, 1983, included City paramedics in Firemen's Fund. (Ill.Rev.Stat.1981, ch. 108½, par. 6-106(a).) In anticipation of the effective date of the amendment, Firemen's Fund began accepting paramedics in its fund on July 1, 1983. After the amendment became effective, making paramedics eligible for membership in Firemen's Fund, approximately 440 paramedics joined Firemen's Fund.
Upon entrance of the paramedics to Firemen's Fund, the Municipal Fund refunded to each of the paramedics the entire amount of their individual contributions paid into the Municipal Fund. The City's matching contributions made on behalf of the individual paramedics, however, remained in the Municipal Fund.
On October 25, 1989, Firemen's Fund filed its first complaint against the Municipal Fund. Thereafter, Firemen's Fund filed an amended two-count complaint alleging actions for unjust enrichment and imposition of a public trust. Firemen's Fund sought transfer of the matching contributions made by the City for the paramedics while members of the Municipal Fund.
On July 6, 1990, the Municipal Fund filed a motion to dismiss the complaint pursuant to sections 2-615 and 2-619 of the Code of Civil Procedure. (Ill.Rev.Stat.1989, ch. 110, pars. 2-615, 2-619.) After hearing arguments of counsel, the circuit court granted the Municipal Fund's motion to dismiss. From the court's order dismissing its complaint, Firemen's Fund appeals.
Firemen's Fund initially contends that the circuit court erred when it held that it had no jurisdiction to grant the relief requested. Specifically, Firemen's Fund maintains that the court should have applied the equitable principle of unjust enrichment to transfer the City's matching contributions from the Municipal Fund to Firemen's Fund.
Firemen's Fund argues here, as it argued before the circuit court, that because it will be responsible to pay disability benefits to the paramedics for injuries that occurred prior to the paramedics' inclusion into Firemen's Fund (in other words, during their inclusion in the Municipal Fund), the Municipal Fund should transfer all contributions made by the City on behalf of those paramedics now in Firemen's Fund. Firemen's Fund further argues that it will be required to calculate and pay annuity and pension benefits based upon the paramedics' entire service as a paramedic, including the time of service prior to their inclusion in Firemen's Fund. Because the purpose of the City's contributions to both pension funds is to aid in the payment of the benefits available to participants in the funds and their beneficiaries, Firemen's Fund contends that the Municipal Fund's retention of in excess of $3 million contributed on behalf of paramedics now participating in Firemen's Fund is improper and inequitable. Thus, Firemen's Fund maintains, the circuit court erred in not ordering the transfer of the contributions pursuant to the principle of unjust enrichment.
In the instant case, the circuit court, after hearing arguments, held that the pension funds were "fundamentally creatures of the legislature" and thus, it was powerless to grant the relief sought by Firemen's Fund. In so holding, the court stated,
"I have thought about this for purposes of appeal, and that's why I have decided that the only reason that the Court is granting the motion is because I'm of the opinion that the Court is without power to grant the relief. Because if I thought that the equitable provisions and powers of this court would allow me to do so, I would do so because it's logical, it's fair, and it's reasonable, only because of [Firemen's Fund's] requirement to consider [the paramedics'] prior service in calculating total pension."
In response to Firemen's Fund's argument that the circuit court erred in dismissing its complaint, the Municipal Fund argues *1006 that it properly retained the City's matching contributions. Specifically, the Municipal Fund contends that it followed statutory requirements to keep the matching contributions in a service annuity reserve. (Ill.Rev.Stat.1989, ch. 108½, par. 8-172.) For support, it relies upon section 8-231 of the Municipal Pension Act, which provides, in pertinent part,
"Any participant in the fund who becomes a participant in any other annuity and benefit fund, * * * may elect to receive a refund or annuity from this fund in the same manner as he would if he then resigned from his position in the service and had not become a participant in such other fund. No credit is allowed for any period of service as a participant in this fund for which the employee receives credit in such other fund, and no annuity shall be paid to such participant by this fund while he holds a position in the service which entitles him to participation in such other fund." (Ill.Rev. Stat.1989, ch. 108½, par. 8-231.)
The Municipal Fund further relies upon section 8-172 of the Municipal Pension Act, which provides in its entirety,
"Whenever any amount is refunded as provided in Section 8-168 and 8-169, except in the case of a male employee who becomes a widower while in service after he becomes age 65, the amounts to the credit of the male employee from contributions by the city, shall be transferred to the prior service annuity reserve. Thereafter any such amounts shall become a credit to the city and, with interest thereon at the effective rate, be used to reduce the amount which the city would otherwise pay during a succeeding year." Ill.Rev.Stat.1989, ch. 108½, par. 8-172.[1]
The Municipal Fund argues that these provisions specifically address the procedures to be used should a participant in the Municipal Fund switch to another pension fund. Because the legislature did not address the possibility that one fund would "rebate" the City's matching contributions to another fund, the Municipal Fund argues that, by exclusion, the legislature did not intend such a result. See Janata v. Police Pension Fund (1986), 140 Ill.App.3d 925, 927, 95 Ill.Dec. 277, 489 N.E.2d 498; Edwards v. Board of Trustees (1974), 22 Ill.App.3d 260, 263, 317 N.E.2d 364 (in construing a statute, it is the duty of this court to enforce the pension law as enacted, according to its plain and unmistakable provisions).
Notwithstanding the Municipal Fund's contention that it is not statutorily required to refund the matching contributions when participants in its fund switch to another fund, Firemen's Fund maintains that the principles of equity demand such a result. Firemen's Fund contends that the pension funds in the instant case are "in the nature of" charitable trusts. Consequently, the courts of equity have the jurisdiction to hear the dispute and the power to award an equitable remedy. See, e.g., County of Cook v. Barrett (1975), 36 Ill. App.3d 623, 632-33, 344 N.E.2d 540 (the control of a trust is a matter exclusively within the jurisdiction of equity); Gavin v. Curtin (1898), 171 Ill. 640, 649, 49 N.E. 523 (if a court has jurisdiction to hear a cause, there is no reason why it should be deemed lacking in power to grant the same character of relief).
Firemen's Fund thus urges this court to apply the doctrine of cy pres to the instant case. While Firemen's Fund's failure to raise this argument in the circuit court is not fatal, its cy pres argument is tenuous. Cy pres applies to property given in trust to be applied to a particular charitable purpose which has become impossible, impracticable, or illegal to carry out; in such a case, the court will direct the application of the property to some charitable purpose falling within the general purpose of the charity. (See City of Aurora ex rel. Egan v. Y.M.C.A. (1956), 9 Ill.2d 286, 294, 137 N.E.2d 347.) However, we do not accept Firemen's Fund's characterization of *1007 the pensions funds in the instant case as "charitable trusts."
The pension funds in the instant case are not in the nature of charitable trusts, but rather are contracts between the participants and the pension fund. (See Gualano v. City of Des Plaines (1985), 139 Ill. App.3d 456, 458, 94 Ill.Dec. 173, 487 N.E.2d 1050.) Moreover, article XIII, section 5 of the Illinois Constitution provides that membership in any pension system of the state "shall be an enforceable contractual relationship." See also Gualano v. City of Des Plaines, 139 Ill.App.3d 456, 94 Ill.Dec. 173, 487 N.E.2d 1050.
Firemen's Fund also urges this court to apply the equitable principle of unjust enrichment. To state a cause of action based on the theory of unjust enrichment, a plaintiff must allege that the defendant has unjustly retained a benefit to the plaintiff's detriment, and that the defendant's retention of that benefit violates fundamental principles of justice, equity, and good conscience. (HPI Health Care Service, Inc. v. Mount Vernon Hospital, Inc. (1989), 131 Ill.2d 145, 160, 137 Ill.Dec. 19, 545 N.E.2d 672.) The cause of action based on unjust enrichment, however, does not require fault or illegality on the part of the defendant; rather, the essence of the cause of action is that one party is enriched and it would be unjust for that party to retain the enrichment. Partipilo v. Hallman (1987), 156 Ill.App.3d 806, 810, 109 Ill.Dec. 387, 510 N.E.2d 8.
As the foregoing attests, both parties have advanced numerous reasons why the circuit court's dismissal of Firemen's Fund's complaint was either in error or proper. Notwithstanding the arguments, the test for the dismissal of a complaint for failure to state a cause of action remains whether it clearly appears that no set of facts can be proved permitting the plaintiff the recovery he seeks. (Kenneke v. First National Bank of Chicago (1978), 65 Ill. App.3d 10, 12, 21 Ill.Dec. 945, 382 N.E.2d 309.) In determining whether a complaint states a cause of action upon which relief can be granted, all well-pleaded facts and reasonable inferences must be taken as true, and if these facts and inferences create a basis for recovery, a dismissal of a cause must be reversed. (Kenneke v. First National Bank of Chicago, 65 Ill.App.3d at 12, 21 Ill.Dec. 945, 382 N.E.2d 309.) Correspondingly, in an action in equity for unjust enrichment, a complaint on which recovery may be based need only allege that there has been unjust retention of a benefit by one party to the detriment of another against the fundamental principles of justice and equity. Kenneke v. First National Bank of Chicago, 65 Ill.App.3d at 12, 21 Ill.Dec. 945, 382 N.E.2d 309.
Here, despite the fact that Firemen's Fund's complaint alleged all the proper elements of unjust enrichment, the circuit court properly dismissed the cause. Although, as the circuit court stated, Firemen's Fund pled and may be able to prove the elements of unjust enrichment, the fact that the pension funds in the instant case are created and maintained by legislative enactment requires this court to enforce the statutes according to their plain and unmistakable provisions. Janata v. Police Pension Fund, 140 Ill.App.3d at 927, 95 Ill.Dec. 277, 489 N.E.2d 498; Edwards v. Board of Trustees, 22 Ill.App.3d at 263, 317 N.E.2d 364.
Both the Firemen's Pension Act and the Municipal Pension Act are lengthy and detailed. The legislature, in enacting the statutes applicable to the pension funds, clearly expended a great deal of effort in including all possible occurrences and results which could take place in the administration of the pension funds. Yet, nowhere in either act did the legislature provide for the transfer of the City's matching contributions from one pension fund to another when participants switch funds. Rather, the legislature specifically provided, in circumstances where the participant withdraws from a pension fund, for the funds to remain in an annuity reserve. (Ill.Rev. Stat.1989, ch. 108½, par. 8-172.) Notwithstanding section 8-172 of the Municipal Pension Act, the legislature has thus far failed to provide for a provision governing the wide-scale mandated transfer of participants from one fund to another, as has *1008 taken place in the instant case. In the absence of such a provision, we find that section 8-172 is applicable to the instant case and mandates that the Municipal Fund retain the City's matching contributions in its annuity reserve fund.
Because a pension board "has no powers beyond those given to it in the act creating it, and has neither the right nor the power to pay moneys to anyone not within the terms of the act fixing the conditions under which a pension is payable" (People ex rel. Langan v. Hansen (1929), 252 Ill.App. 212, 221, citing People ex rel. Drea v. Hanson (1928), 330 Ill. 79, 161 N.E. 145), the circuit court did not err in refusing to usurp the power of the legislature to dictate the rights and responsibilities of the pension funds. Thus, we find that the circuit court properly dismissed Firemen's Fund's cause for failure to state a set of facts upon which recovery can be granted.
For the foregoing reasons, the judgment of the circuit court of Cook County is affirmed.
Affirmed.
SCARIANO, P.J., and HARTMAN, J., concur.
NOTES
[1]  Section 8-168 governs the procedures used when a participant withdraws from a pension fund and resigns from his position in the service. See also Ill.Rev.Stat.(1989), ch. 108½, par. 8-231.
