#### In re MARRIAGE OF MAUREEN E. RIFE, Petitioner-Appellee, and KEVIN L. RIFE, Respondent-Appellant.

Second District

No. 2 — 06—1048

Opinion filed October 24, 2007.

*1051Carol L. Hill, of Mohr, Bruce, Nader, Hirsch & Hill, of McHenry, for appellant.

William P. Gibbs, of Law Office of William P. Gibbs, of South Elgin, for appellee.

PRESIDING JUSTICE GROMETER

delivered the opinion of the court:

Respondent Kevin L. Rife appeals an order denying his petition under section 2 — 701 of the Code of Civil Procedure, commonly referred to as the Declaratory Judgment Act (Act) (735 ILCS 5/2 — 701 (West 2004)). On appeal, respondent argues that the trial court erred in holding that petitioner Maureen E. Rife’s response to his postdissolution petition to reduce child support was not itself a “petition” as defined by a provision (modification clause) in the marital settlement agreement (MSA) incorporated into the dissolution judgment. Petitioner argues that the trial court correctly held that her response was not a “petition” so as to trigger the modification clause and require that funds in an individual retirement account (IRA) in her name be transferred to an IRA in respondent’s name. Petitioner also argues that the modification clause is unenforceable because it violates public policy. We agree with petitioner’s second argument, and we affirm.

On January 28, 2004, the trial court dissolved the parties’ marriage. The MSA gives the parties joint custody of their two children: Gabrielle, born in 1998, and Mitchell, born in 2000. Respondent is the “residential parent,” and petitioner agrees to supervise the children when she has “parenting time.” Each party must be kept informed of the children’s “day to day residence.” Each party shall have “liberal and reasonable parenting time,” and the parties “can agree on weekend, weekday, holiday, and vacation parenting time between them without the necessity of specifying specific [sic] times herein, said parenting times to be established.” The children shall continue attending a Montessori school for the 2004-05 school year; if the parties cannot agree on the children’s future schooling, they shall attempt to resolve their differences by mediation.

Article VI of the MSA addresses child support. Paragraph 1 recites that, in the children’s interests, petitioner ought to “receiv[e] financial assistance for the minor children during her parenting time.” To this end, respondent shall use funds from his employee stock ownership plan to establish a $260,000 IRA in her name. Petitioner may withdraw from the IRA $1,900 per month for child support, to be reduced to $1,390 per month as soon as there is only one minor child. If both *1052children become emancipated, any money in the IRA reverts to respondent. Petitioner is solely responsible for taxes and penalties imposed if she withdraws money from the IRA. She may claim a “dependency exemption” for Gabrielle, and respondent may claim one for Mitchell.

Paragraph 1 contains the modification clause, which states:

> “In the event that MAUREEN attempts to modify the weekly visitation, the residency of the children, or the support structure provided and established herein, by petitioning for such relief with a Court of competent jurisdiction, MAUREEN’s right to withdraw funds from the established IRA fund would immediately cease and the IRA would immediately be transferred to an IRA in KEVIN’s name. Obviously, modification of the weekly visitation, the residency children [szc], or the support structure provided for herein, or any related issue, could always be modified [szc] by agreement of the parties without the consequence of the cessation of the withdrawal of funds and transfer of the IRA.

> In the event that MAUREEN attempts to modify the weekly visitation, the residency of the children, or the support structure provided herein, by petitioning for such relief with a Court of competent jurisdiction, she shall immediately deliver good and sufficient instruments necessary and proper to transfer the established IRA to an IRA in KEVIN’s name. If she, for any reason, shall fail or refuse to execute any such documents ***, then any judge or associate judge of the Circuit Court of McHenry County [shall] execute and deliver any and all such documents in her place and stead.”

The parties filed various postdissolution petitions. On January 3, 2006, respondent petitioned to remove the children from the Montessori school in Crystal Lake to Neubert, a public school near his home. On January 20, 2006, by an agreed order, the trial court ruled that both children would attend the Montessori school through spring 2006 but, beginning in fall 2006, would attend school in the community where the residential parent lived.

On April 28, 2006, respondent filed three petitions to modify the dissolution judgment. The first, to decrease child support, alleged that petitioner had recently remarried; that she was currently unemployed and had not contributed to the children’s needs as much as the judgment required; that, as of fall 2006, the children would be attending Neubert; and that, because the “current parenting time” was “being modified to a more traditional schedule,” petitioner would need less financial support than under the “split parenting time arrangement.” The petition asked the court to decrease the monthly withdrawal from the IRA from $1,900 to $500.

*1053Respondent’s second petition, “to set parenting time,” asserted that the parties would no longer “split parenting time” and asked the court to set a “definite parenting *** schedule” for petitioner. Respondent’s third petition asked permission to claim both children as dependents on his tax return.

Petitioner’s answers to the first and third petitions did not request relief beyond the denials of the petitions and awards of attorney fees. However, in answering the petition to set parenting time, she alleged that it was in the children’s best interests to award her “their primary day to day care.” She asked the court to “[d]eny [the] Petition to Set Parenting Time; alternatively, award [her] the children’s day to day care, while awarding [him] a reasonable liberal visitations [sic] schedule.”

On June 7, 2006, respondent filed his petition under the Act. He alleged that petitioner’s answer to his petition to set parenting time was in substance a counterpetition and thus triggered the modification clause. Petitioner denied that her answer to the petition was a counterpetition and alleged that the modification clause was against public policy because it penalized her for seeking relief that might be in the children’s best interests.

On July 17, 2006, the trial court denied respondent’s petition under the Act. The court held that the modification clause would have been triggered only had petitioner “take[n] an affirmative step or ‘set the wheels in motion’ ” but that she did not do so merely by answering respondent’s petition to set parenting time. Having held that the modification clause did not apply, the court did not decide whether it violated public policy. On September 28, 2006, with various other post-dissolution petitions pending, the court found that there was no just reason to delay the enforcement or appeal of its order (155 Ill. 2d R. 304(a)). Respondent appeals.

On appeal, respondent again contends that, by asking the trial court to award her custody of the children, petitioner “attempted] to modify” the dissolution judgment by “petitioning] for such relief,” triggering the modification clause. Because we agree with petitioner that the modification clause violates public policy, we affirm. Although the trial court did not decide this issue, we may affirm its judgment on any basis of record. See Travelers Casualty & Surety Co. v. A.G. Carlson, Inc., 368 Ill. App. 3d 519, 522 (2006). In explaining our holding, we shall address the construction of the modification clause only as necessary to our discussion of why it violates public policy.

We recognize that we are deciding this appeal on a relatively broad ground by holding that the modification clause is unenforceable, even though we might avoid this issue by first considering whether the trial *1054court correctly held that the clause does not apply here. Nonetheless, we believe that our holding is not merely proper but necessary. Even if the modification clause does not apply this time, respondent may well invoke it again if petitioner ever seeks a modification of the dissolution judgment. As important, the very existence of the modification clause would tend to deter petitioner from seeking a change in custody, child support, or visitation, even if it would be in the children’s best interests. Thus, whether or not the children’s interests are presently affected by the modification clause, those interests are bound to be so affected in the future, even if neither party actually litigates issues relating to custody, support, or visitation.

We turn to the general principles of law applicable to our review of the issues that respondent raises on appeal. The construction of a contract and whether the contract violates public policy raise issues of law, which we review de novo. See Avery v. State Farm Mutual Automobile Insurance Co., 216 Ill. 2d 100, 129 (2005) (construction of contract); Zeigler v. Illinois Trust & Savings Bank, 245 Ill. 180, 192 (1910) (whether contract violates public policy); Rome v. Upton, 271 Ill. App. 3d 517, 520 (1995) (same). Therefore, were we to review the trial court’s conclusion that the modification clause does not apply here, or had the trial court decided whether the modification clause violates public policy, we would owe its judgment no deference. Also, because we consider the second issue de novo, it does not matter that the trial court did not decide it at all, and thus we do not infringe on any trial court prerogatives by declining to allow the trial court to rule on the issue first.

We recognize that a number of Illinois opinions, including several that the parties cite, state broadly that a judgment on the merits of a complaint under the Act may be reversed only if the judgment is an abuse of discretion. See East St. Louis School District No. 189 Board of Education v. East St. Louis School District No. 189 Financial Oversight Panel, 349 Ill. App. 3d 445, 453 (2004); Werst v. Three Fires Council of the Boy Scouts of America, 346 Ill. App. 3d 706, 714 (2004); State Farm Fire & Casualty Co. v. Leverton, 314 Ill. App. 3d 1080, 1083 (2000); Bodine Electric of Champaign v. City of Champaign, 305 Ill. App. 3d 431, 435 (1999); Galesburg Clinic Ass’n v. West, 302 Ill. App. 3d 1016, 1017-18 (1999); Radke v. Independence Tube Corp., 301 Ill. App. 3d 713, 714 (1998); R.L. Polk & Co. v. Ryan, 296 Ill. App. 3d 132, 142 (1998); Board of Regents of the Regency University System v. Reynard, 292 Ill. App. 3d 968, 975 (1997); Athanas v. City of Lake Forest, 276 Ill. App. 3d 48, 52 (1995); Gaiser v. Village of Skokie, 271 Ill. App. 3d 85, 90-91 (1995); McDonald’s Corp. v. First National Bank of Lake Forest, 252 Ill. App. 3d 806, 812 (1993); Dunlap v. Illinois *1055 Founders Insurance Co., 250 Ill. App. 3d 563, 568 (1993); Bank of Chicago-Garfield Ridge v. Park National Bank, 237 Ill. App. 3d 1085, 1090 (1992); Schneiderman v. Kahalnik, 200 Ill. App. 3d 629, 633 (1990); Scot Lad Foods, Inc. v. First Bank & Trust Co., 190 Ill. App. 3d 773, 775-76 (1989); State Farm Mutual Automobile Insurance Co. v. Dreher, 190 Ill. App. 3d 182, 185 (1989); Carl Sandburg Village Condominium Ass’n No. 1 v. Carl Sandburg Village Condominium Homeowners’ Ass’n, 175 Ill. App. 3d 1, 5 (1987); Feeley v. Michigan Avenue National Bank, 141 Ill. App. 3d 187, 190-91 (1986); Hernandez v. Fahner, 135 Ill. App. 3d 372, 380-81 (1985). However, these opinions contain unsound and sometimes inconsistent statements about the appellate review of declaratory judgments. We provide several examples.

In Hernandez, the appellate court reviewed a grant of summary judgment that was based on a pure question of law — the meaning of a statute. The Attorney General appealed a declaratory judgment construing the statute favorably to the plaintiffs. Hernandez, 135 Ill. App. 3d at 374. Citing Howlett v. Scott, 69 Ill. 2d 135, 142 (1977), and Wills v. O’Grady, 86 Ill. App. 3d 775, 779 (1980), the court stated that, because the grant or denial of declaratory relief is discretionary, the trial court’s judgment would not be reversed absent an abuse of discretion. Hernandez, 135 Ill. App. 3d at 380-81. However, citing Chicago & Eastern Illinois R.R. Co. v. Reserve Insurance Co., 99 Ill. App. 3d 433, 436 (1981), the court added that the trial court’s decision was subject to “searching appellate review” and would be accorded less deference than trial courts’ exercises of discretion in other contexts. Hernandez, 135 Ill. App. 3d at 381. The court then construed the statute independently and concluded that the trial court “did not abuse its discretion.” Hernandez, 135 Ill. App. 3d at 382.

In Carl Sandburg Village Condominium Ass’n No. 1, the appellate court sought to reconcile what it saw as contradictory imperatives for the review of a grant of summary judgment on the merits of a declaratory judgment suit. The court recognized that the issue before it, the construction of condominium declarations, was a “pure question of law.” Carl Sandburg Village Condominium Ass’n No. 1, 175 Ill. App. 3d at 5. Yet, citing Howlett, it then stated that the trial court’s decision whether to grant declaratory relief is discretionary. Carl Sandburg Village Condominium Ass’n No. 1, 175 Ill. App. 3d at 5. Citing Feeley and Chicago & Eastern, the court stated that the trial court’s “discretionary decision” would be subject to “searching” review. Carl Sandburg Village Condominium Ass’n No. 1, 175 Ill. App. 3d at 5. The court did not explain what it meant by the “searching” review of a “discretionary” ruling on a pure question of law. However, it reviewed the question of law independently and concluded that the trial court’s *1056interpretation of the declarations was correct. Carl Sandburg Village Condominium Ass’n No. 1, 175 Ill. App. 3d at 6.

In similar fashion, the court in Bank of Chicago-Garfield Ridge recognized that the summary judgment before it was subject to de novo review. Bank of Chicago-Garfield Ridge, 237 Ill. App. 3d at 1090. Citing Howlett, Carl Sandburg Village Condominium Ass’n No. 1, and Chicago & Eastern, among other opinions, the court then stated that the grant of declaratory relief is discretionary but that the exercise of this discretion is subject to “searching” appellate review and not given the same deference as elsewhere. Bank of Chicago-Garfield Ridge, 237 Ill. App. 3d at 1090. The court then reviewed de novo the issues of law before it and affirmed the trial court. Bank of Chicago-Garfield Ridge, 237 Ill. App. 3d at 1091-93.

In Dreher, Robert Dreher was injured while driving his mother’s car, and the plaintiff insurer claimed that a policy exclusion applied because the mother furnished the car for her son’s regular or frequent use. Apparently, the operative facts were undisputed. The trial court held for the defendants on the merits. In reversing, the appellate court, citing Chicago & Eastern, stated that, on an appeal from a declaratory judgment, a reviewing court does not give “the trial court’s exercise of discretion *** the same deference as in other proceedings.” Dreher, 190 Ill. App. 3d at 185. However, the court resolved the question of law before it by holding that the car was available for Robert Dreher’s regular and frequent use and thus that the exclusion applied. Dreher, 190 Ill. App. 3d at 185.

The Dreher court stated that, because the appeal was from a judgment under the Act, review would be deferential, albeit in some gray zone between normal deferential review and de novo review. The court actually decided the question of law as it would have any other. Thus, the court’s actual resolution of the issue was correct, but its introductory language implied that the question of law before it — the application of contractual language to undisputed facts — would receive deference merely because the trial court had decided it by a declaratory judgment.

In McDonald’s, the issue was whether the trial court had correctly ruled that a contract between the plaintiff and one of the defendants unambiguously prevented that defendant from erecting a sign on its property. The appellate court recognized that the issue was one of law and thus subject to de novo review. McDonald’s, 252 Ill. App. 3d at 809. Yet, after concluding that the trial court construed the contract incorrectly, the appellate court held that the judgment was “an abuse of its discretion.” McDonald’s, 252 Ill. App. 3d at 812. In Reynard, the issue was whether, on undisputed evidence, the trial court had cor*1057rectly held that a particular entity was a “public body” as defined by two statutes. Reynard, 292 Ill. App. 3d at 977. The appellate court stated that the trial court’s decision was discretionary and thus subject to deferential review. Reynard, 292 Ill. App. 3d at 975. The court then decided the question of law before it in conventional fashion, independently construing the statutes and affirming the judgment. Reynard, 292 Ill. App. 3d at 979.

In Bodine, the appellate court continued and aggravated the confusion, although again the eventual result apparently was not tainted thereby. The court stated that, although the grant or denial of declaratory relief is “discretionary,” the trial court’s exercise of discretion is “not given the same deference as in other contexts.” Bodine, 305 Ill. App. 3d at 435. Next, the court implied that no deference at all is appropriate:

> “ ‘Independent review is justified because the exercise of the trial court’s discretion in granting or denying declaratory relief is not dependent upon factors which are difficult for an appellate tribunal to review, such as, for example, factual determinations of credibility [sic].’ ” (Emphasis added.) Bodine, 305 Ill. App. 3d at 435, quoting Chicago & Eastern, 99 Ill. App. 3d at 436-37.

However, the court followed this pronouncement by defining “abuse of discretion” as “clearly against logic” and stating that a trial court abuses its discretion only when it acts “arbitrarily” or “exceed[s] the bounds of reason and ignore[s] recognized principles of law so that substantial prejudice result[s].” Bodine, 305 Ill. App. 3d at 435. Incongruously, the court then stated that “review [of] declaratory judgments, therefore, is less deferential than abuse of discretion, but more deferential than de novo review.” (Emphasis added.) Bodine, 305 Ill. App. 3d at 436. The court added one last ingredient to its boilerplate gallimaufry: the conclusion that the reviewing court must decide “ ‘whether the decision of the trial court [in denying or granting declaratory relief] was proper.’ ” Bodine, 305 Ill. App. 3d at 436, quoting First National Bank v. County of Lake, 7 Ill. 2d 213, 224 (1955). This statement is undoubtedly correct, but it is not very helpful.1

In its discussion of the issues, the appellate court did not explicitly *1058invoke any of these standards, except to hold that, in applying a statute to undisputed facts, the trial court “did not act arbitrarily, without employing conscientious judgment” or “exceed the bounds of reason and ignore recognized principles of law so that substantial prejudice resulted.” Bodine, 305 Ill. App. 3d at 440. Thus, after stating that its review would be less deferential than usual, the court used extremely deferential language — and did so while reviewing the trial court’s resolution of a question of law.

As with the other opinions that we have summarized, Bodine’s confused exposition of the law seems not to have tainted its ultimate resolution of the issues before it, if indeed it had any effect at all. Nonetheless, in the future, these opinions might well leave courts of review in a quandary about whether to treat judgments under the Act with deference, even when doing so would seem to deviate from established practice. Therefore, we shall seek to clear up the confusion. We believe that it results from the misreading of opinions that properly construe and apply the Act. Specifically, these opinions recognize a basic distinction that Bodine and others neglect: the distinction between (1) appellate review of the trial court’s decision on the appropriateness of declaratory judgment at all, regardless of the merits of the substantive claim — what we shall call “procedural review” — and (2) appellate review of the trial court’s ruling on the merits of the substantive claim — what we shall call “substantive review.” Neither review necessarily requires a particular level of deference, as the level of deference depends on the precise issue at hand. However, to avoid the confusion, a reviewing court is wise to treat each review separately; the standard that applies to the one does not automatically apply to the other.

Our holding is merely the application of the larger principle that whether appellate review of trial courts’ decisions is deferential is a function of the division of labor between trial courts and courts of review. Courts of review accord deference to those trial court decisions that are within the special competence of the trial courts, and only to those decisions. When we are reviewing a type of decision that the *1059trial court was better qualified to make, we must proceed with due recognition of the tried court’s superior vantage point. Otherwise, we must exercise our prerogative to decide the issue without deference to the trial court. See generally Franz v. Calaco Development Corp., 352 Ill. App. 3d 1129, 1144 (2004).

To explain, we start with the Act itself, which, as pertinent here, provides:

> “The court may, in cases of actual controversy, make binding declarations of rights, having the force of final judgments, whether or not any consequential relief is or could be claimed, including the determination, at the instance of anyone interested in the controversy, of the construction of any statute, municipal ordinance, or other governmental regulation, or of any deed, will, contract or other written instrument, and a declaration of the rights of the parties interested. The foregoing enumeration does not exclude other cases of actual controversy. The court shall refuse to enter a declaratory judgment or order, [sic] if it appears that the judgment or order, [sic] would not terminate the controversy or some part thereof, [sic] giving rise to the proceeding.” (Emphasis added.) 735 ILCS 5/2 — 701(a) (West 2004).

The use of the term “may” demonstrates that the legislature intended to allow a trial court to decide, in its discretion, whether the use of the Act is appropriate in a particular case. See Krautsack v. Anderson, 223 Ill. 2d 541, 554 (2006); People v. Young, 124 Ill. 2d 147, 157 (1988). We note that the Act provides further that the trial court has such discretion only if there is an “actual controversy” (735 ILCS 5/2 — 701(a) (West 2004)) and that the court “shall refuse” to enter a declaratory judgment if it appears that doing so “would not terminate the controversy or some part thereof, [sic] giving rise to the proceeding.” (Emphasis added.) 735 ILCS 5/2 — 701(a) (West 2004). To this extent, the trial court’s decision is not discretionary: it is obligated to dismiss a complaint for declaratory judgment (at least if a motion to dismiss has been filed) if the actual controversy that gave rise to the proceeding cannot be resolved in whole or in part through such a judgment. See Young, 124 Ill. 2d at 157; Maschhoffv. Klockenkemper, 343 Ill. App. 3d 500, 505 (2003) (ordinarily, use of “shall” imposes mandatory obligation). Accordingly, to the extent that this mandatory provision is at issue, our review is de novo. However, subject to this requirement, the appropriateness of the Act as a vehicle for relief is a question for the trial court’s discretion, and our review is deferential.

We have recognized that, as opposed to the trial court’s determination of whether the Act is appropriate at all, which generally calls for deferential review (an exception being the de novo review that applies *1060to the mandatory provision of the Act), the trial court’s judgment on the merits is “subject to de novo review to the extent it is not based on factual determinations that are the trial court’s province.” Inland Land Appreciation Fund, L.P. v. County of Kane, 344 Ill. App. 3d 720, 724 (2003). Ironically, however, the two opinions that we cited for this sound principle — Galesburg Clinic Ass’n and Athanas — do not themselves clearly observe it. Both Galesburg Clinic Ass’n and Athanas misread sound precedent (or correctly read unsound precedent). Galesburg Clinic Ass’n, citing Drayson v. Wolff, 277 Ill. App. 3d 975, 979 (1996), states broadly that a declaratory judgment on the merits, such as the one there, must be reviewed for an abuse of discretion, albeit with less deference than is usually given to the trial court’s exercise of its discretion. Galesburg Clinic Ass’n, 302 Ill. App. 3d at 1017-18. (The opinion does recognize that the trial court’s factual findings are to be reviewed with the customary deference accorded such findings. Galesburg Clinic Ass’n, 302 Ill. App. 3d at 1018.) However, Drayson reviews deferentially only the trial court’s decision to proceed under the Act (Drayson, 277 Ill. App. 3d at 979-80) and not its judgment on the merits, involving contract construction. Drayson reviews that issue of law de novo, albeit without explicitly saying so. Drayson, 277 Ill. App. 3d at 980-82.2 Athanas cites Gaiser, which does indeed state that a declaratory judgment on the merits is reviewed for abuse of discretion. Gaiser, 271 Ill. App. 3d at 91. However, Gaiser mistakenly relies on Chicago & Eastern, which distinguishes between procedural review under the discretionary provision of the Act and substantive review and recognizes that only the former necessarily requires deference to the trial court’s exercise of its discretionary prerogative.

The case law is disturbingly rich in such misapplications of sound precedent. Howlett addresses only procedural review, a point not grasped by the courts in Bank of Chicago-Garfield Ridge, 237 Ill. App. 3d at 1090, Carl Sandburg Village Condominium Ass’n No. 1, 175 Ill. App. 3d at 5, and Hernandez, 135 Ill. App. 3d at 380-81. Similarly, although Chicago & Eastern distinguishes between procedural review and substantive review, Bodine, 305 Ill. App. 3d at 435, Dreher, 190 Ill. App. 3d at 185, Carl Sandburg Village Condominium Ass’n No. 1, 175 Ill. App. 3d at 5, Feeley, 141 Ill. App. 3d at 190-91, and Hernandez, *1061 135 Ill. App. 3d at 381, all misapply to substantive review its principles governing procedural review, a mistake that Chicago & Eastern itself clearly avoids. (Hernandez, 135 Ill. App. 3d at 381, also incorrectly relies on Wills, 86 Ill. App. 3d at 779, which addresses only procedural review and not the merits of the complaint there.)

The result of these lapses is a profusion of unsupportable and confusing statements, obstructing what should be a commonsense approach to the appellate review of declaratory judgments. Under the discretionary provision of the Act, the trial court’s decision whether a declaratory judgment proceeding is proper at all is subject to deferential, if “searching,” review. However, nothing in the Act requires that a trial court’s resolution of the merits of the complaint be entitled to deference. To impose such a requirement would make the trial court the primary authority on questions of law, inverting the hierarchy of lower court and higher court. Or, perhaps, it would merely perpetuate appellate courts’ attempts to escape from their self-imposed dilemma by uprooting the concept of “searching” review from its proper context and invoking it, if only as a shamanistic incantation, in the wrong context. We see no reason to engage in the pretense or legal fiction of conducting deferential review when what we are really performing is de novo review. As important, courts should not actually conduct deferential review of trial court rulings that do not deserve any deference. Therefore, insofar as East St. Louis School District, Werst, Leverton, Bodine, Galesburg Clinic Ass’n, Radke, R.L. Polk, Reynard, Athanas, Gaiser, McDonald’s, Dunlap, Bank of Chicago-Garfield Ridge, Schneidermann, Scot Lad Foods, Dreher, Carl Sandburg Village Condominium Ass’n No. 1, Feeley, and Hernandez hold that the grant of a declaratory judgment on the merits is necessarily discretionary, or that the review of such a judgment is necessarily deferential, they are unsound, and we do not follow them.

Before turning to the merits of this appeal, we address an argument that petitioner raises. She contends that the trial court should not have entered a declaratory judgment for respondent, because doing so would not have “terminated] the controversy or some part thereof, [sic] giving rise to the proceeding.” 735 ILCS 5/2 — 701(a) (West 2004); see In re Marriage of Weber, 182 Ill. App. 3d 208, 210-11 (1989). In essence, petitioner wants us to affirm the trial court’s judgment on the merits but to do so by holding that, per the mandatory provision of the Act, the trial court erred in deciding the merits. We note again that our review on this point would be de novo. However, if, arguendo, we could properly affirm the judgment on this unique basis, we would decline to do so.

Respondent’s petition sought a declaration that petitioner’s *1062response to his petition to reduce child support triggered the modification clause, requiring that funds in the IRA in her name be transferred immediately to an IRA in his name. Thus, the petition raised an independent controversy, one that did not depend on the resolution of any other that was pending in the trial court. The trial court decided this discrete controversy by denying respondent relief; had the court granted him relief, it would also have resolved the controversy. Deciding the petition on the merits was wholly consistent with the purposes of the Act and was not error. Petitioner’s belated argument for dismissal is unpersuasive, so we turn to the merits of respondent’s appeal.

Respondent argues that the modification clause is unambiguous and that petitioner triggered it by requesting that the trial court award her custody of the children. He notes that the MSA awards joint custody and makes him the “residential parent.” He maintains that, by affirmatively requesting that the trial court award her the children’s “primary day to day care,” petitioner (in the words of the modification clause) “attempted] to modify the weekly visitation, the residency of the children, or the support structure provided and established, by petitioning for such relief.”

Petitioner disputes this assertion, but, more important to our resolution of this appeal, she contends that the modification clause violates public policy and is unconscionable. She argues that she should not lose the use of the funds in the IRA, which enable her to provide for the children’s needs, merely because she seeks to modify custody, child support, or visitation, as such a change might be in the children’s best interests. Respondent argues that petitioner freely agreed to the modification clause, which was part of the consideration that she paid for what she received via the MSA. He notes that, under the MSA, petitioner received child support even though custody was joint and she was not the “residential parent” and that the trial court approved the MSA as fair.

We hold that the modification clause is against public policy and thus void. We do not decide whether it is also unconscionable. Although the degree to which the modification clause works a hardship on petitioner is highly relevant to our conclusion, the effect on petitioner is not in itself the principal reason why the clause violates public policy. Instead, its fatal defect is that, because its intent and natural effect are to deter petitioner from seeking modifications in the child-related provisions of the judgment, it is tantamount to an agreement not to modify child custody, child support, or visitation. Our conclusion would be the same even if the clause restricted respondent equally. It does not matter whether petitioner freely assented to the modifica*1063tion clause or received some sort of consideration for it; that would not make the clause any more consistent with the public policy of preserving the trial court’s ability to modify the child-related provisions of the judgment if it concludes that to do so is in the best interests of the children.

Whether or not a contract is contrary to public policy depends on the particular facts of the case. O’Hara v. Ahlgren, Blumenfeld & Kempster, 127 Ill. 2d 333, 341-42 (1989). This state’s public policy is reflected in its constitution, its statutes, and its judicial decisions. O’Hara, 127 Ill. 2d at 341; In re Estate of Braun, 222 Ill. App. 3d 178, 182 (1991). In deciding whether an agreement, such as a marital settlement agreement, is against public policy, we must consider whether the agreement is so capable of producing harm that its enforcement would be contrary to the public interest. O’Hara, 127 Ill. 2d at 342; Estate of Braun, 222 Ill. App. 3d at 182. The issue is one of law, and thus our substantive review here is de novo. See Vine Street Clinic v. HealthLink, Inc., 353 Ill. App. 3d 929, 932 (2004), rev’d in part on other grounds, 222 Ill. 2d 276 (2006).

The public policy relevant here is embodied in section 502(f) of the Illinois Marriage and Dissolution of Marriage Act (750 ILCS 5/502(f) (West 2004)), which governs marital settlement agreements in dissolution judgments, and the case law applying it. Section 502(f) states, “Except for terms concerning the support, custody or visitation of children, the judgment may expressly preclude or limit modification of terms set forth in the judgment if the agreement so provides. Otherwise, terms of an agreement *** are automatically modified by modification of the judgment.” (Emphasis added.) 750 ILCS 5/502(f) (West 2004).

“ ‘The purpose of subsection (f) is to permit the parties to preclude or limit modification of terms pertaining to maintenance, and other matters, excluding matters pertaining to children.’ ” (Emphasis in original.) In re Marriage of Loffredi, 232 Ill. App. 3d 709, 711 (1992), quoting Ill. Ann. Stat. ch. 40, par. 502, Historical & Practice Notes, at 402 (Smith-Hurd 1980). Our courts recognize that section 502(f) prevents parties to a dissolution judgment from agreeing not to seek the judicial modification of the judgment’s provisions pertaining to their children.

In In re Marriage of Glickman, 211 Ill. App. 3d 792 (1991), the marital settlement agreement provided that the wife would not petition for more child support. However, she later did so. Relying on the provision in the agreement, the trial court dismissed the petition. The appellate court reversed, holding that the provision was against public policy. The court explained that, in enacting and construing section *1064502(f), the legislature and the courts had “clearly enunciated that a judgment or settlement agreement incorporated therein cannot preclude or limit modification of terms concerning support, custody or visitation of children.” Glickman, 211 Ill. App. 3d at 795.

In In re Marriage of Gleason, 266 Ill. App. 3d 467 (1994), the dissolution judgment contained an agreement setting child support at a certain level and stating that the amount could not be modified until six years later. A few months later, after the husband lost his job, he petitioned to reduce child support. The trial court held that the six-year clause barred the modification, and it denied the petition. The appellate court reversed, explaining that, under section 502(f), child support is always modifiable upon a showing of a substantial change in circumstances and that the parties could not evade the statute. Gleason, 266 Ill. App. 3d at 468. The court also reasoned that, under section 502(f), the agreement would not prevent a court from increasing child support upon the wife’s petition and thus it ought not prevent a court from reducing child support if the husband’s circumstances required. Gleason, 266 Ill. App. 3d at 469.

Glickman and Gleason apply the public policy written into section 502(f) that, although the parties to a dissolution judgment may agree to the terms that relate to the custody, support, and visitation of their children, so long as those terms meet with the court’s approval, they may not circumvent the court’s authority to determine later whether the best interests of the children (or the needs of the payor spouse) require changing any of those terms. The parties may not contract away their rights to petition to modify such provisions, because “[t]he court is obligated *** to protect the best interests of the children involved.” Blisset v. Blisset, 123 Ill. 2d 161, 167 (1988); see also In re Support of Burks, 100 Ill. App. 3d 700, 703 (1981) (parties may not agree to make child support nonmodifiable).

Unlike the agreements in Glickman and Gleason, the one here does not absolutely bar the modification of child custody, support, or visitation. Nonetheless, both its plain intention and its natural effect are to deter petitioner from even seeking such changes, great or small, no matter how necessary or desirable they are for the children. Thus, the modification clause is tantamount to a promise not to seek the just modification of child support, custody, or visitation — the sort of promise that Glickman and Gleason hold that section 502(f) forbids. It all but goes without saying that the modification clause is so capable of producing harm that its enforcement would be contrary to the public interest. Indeed, the intended effect of the clause — chilling petitioner’s exercise of her right to seek judicial intervention in the best interests of the children — is such harm.

*1065At oral argument, respondent’s counsel argued that the modification clause would not deter petitioner from seeking changes in custody, support, or visitation. Counsel observed that the MSA sets petitioner’s monthly support level at $1,900, and counsel reasoned that this amounts to a recognition or admission that petitioner needs this amount of monthly support. Therefore, counsel concluded, although petitioner would forfeit the $1,900 monthly payment from the IRA by merely asking the trial court to modify custody, support, or visitation, she would also be able to petition the court for $1,900 monthly support from respondent, and the MSA’s support provision would be evidence that she was entitled to this amount. Therefore, counsel maintained, the modification clause would not deter petitioner from seeking to modify the child-related aspects of the MSA.

We reject respondent’s attempt to minimize the significance of the modification clause. We cannot agree that there is no deterrent effect from having to forgo the proverbial “bird in the hand” for “one in the bush.” Under the MSA, petitioner is entitled to $1,900 per month, drawn from an IRA with a principal of $260,000. If she seeks a judicial modification of some child-related provision of the MSA, she immediately loses any access to the IRA. There is no guarantee that the trial court would accept the $1,900 figure as a proxy for petitioner’s needs, and there is no assurance that she would be able to secure that amount from respondent, given the potential uncertainty of respondent’s circumstances. Moreover, respondent’s argument appears slightly disingenuous: he asserts that the modification clause lacks a deterrent effect because it has no effect at all, ultimately changing nothing about the parties’ financial relationship. Were that so, it would be unclear why respondent is so insistent that the modification clause be upheld.

We hold that the modification clause is void and that the trial court properly denied respondent relief.

The judgment of the circuit court of McHenry County is affirmed.

Affirmed.

O’MALLEY and CALLUM, JJ., concur.

1

Bodine’s use of First National Bank implies that the supreme court intended therein to promulgate a (vacuous) general rule for reviewing declaratory judgments. However, the supreme court’s focus in using the quoted language was not at all on setting forth rules for the review of declaratory judgments, but on defining the substantive issues in the particular appeal before it. The plaintiff had unsuccessfully sought a declaratory judgment that the defendant’s zoning ordinance was unconstitutional as applied. “Before stating the principles of law to be applied to the facts presented” (emphasis *1058added) (First National Bank, 7 Ill. 2d at 224), the court noted that, although the trial court had heard evidence on the defendant’s refusal to rezone the plaintiff’s property, the propriety of the denial of rezoning had not been properly raised as a separate claim in the trial court. Therefore, “the only question presented by this appeal [was] whether the decision of the trial court in sustaining *** the ordinance was proper.” (Emphasis added.) First National Bank, 7 Ill. 2d at 224. The supreme court’s statement makes sense in its context, framing the issues in the appeal before it, but is pointless in the wholly different context into which Bodine places it.

2

Radke similarly misreads Drayson. Radke, 301 Ill. App. 3d at 714. However, in essence, if not in semantics, it reviews de novo the issue of law before it — whether, on given facts, one of the defendants had obtained an easement — although it concludes that the trial court “did not abuse its discretion” in deciding the issue. Radke, 301 Ill. App. 3d at 715.