
958 N.E.2d 1100 (2011)
354 Ill. Dec. 904
The RESERVE AT WOODSTOCK, LLC, Plaintiff-Appellee,
v.
The CITY OF WOODSTOCK, Katherine Thornton, in Her Official Capacity as Chairperson of the City of Woodstock Plan Commission, and Brian Sager, in His Official Capacity as Mayor of the City of Woodstock, Defendants-Appellants.
No. 2-10-0676.
Appellate Court of Illinois, Second District.
September 28, 2011.
*1104 Jennifer J. Gibson, Gregory J. Barry, Zukowski, Rogers, Flood & McArdle, Crystal Lake, for City of Woodstock, Brian Sager, Mayor of the City of Woodstock, Katherine Thornton, Chairperson.
James R. Griffin, Thomas R. Burney, Michael R. Burney, Schain, Burney, Banks & Kenny, Ltd., Chicago, for The Reserve at Woodstock, LLC.

OPINION
Justice BOWMAN delivered the judgment of the court, with opinion.
¶ 1 In this case, plaintiff, The Reserve at Woodstock, LLC (Reserve), submitted a plat to defendant, the City of Woodstock (City), to develop certain property pursuant to an annexation agreement (Annexation Agreement). The City denied the plat and eventually rezoned and disconnected the property. Reserve filed suit; the trial court found in favor of Reserve; and the City appeals. Because the City violated its duty of good faith and fair dealing under the Annexation Agreement by rezoning and disconnecting the property, the trial court properly granted summary judgment in favor of Reserve as to counts VII and VIII. In addition, because Reserve acquired a vested right in the approval of its plat under the prior zoning ordinance, the court properly entered judgement in its favor as to counts IV, V, and VI. Accordingly, we affirm.

¶ 2 I. BACKGROUND
¶ 3 The property at issue is approximately 10 acres of land in Woodstock. First Bank of Oak Park was the original owner of the property, which was annexed to the City pursuant to the Annexation Agreement, dated May 18, 1993. The Annexation Agreement, which zoned the property as residential, was binding on the parties for a term of 20 years. In addition, it contained two provisions relevant to this appeal. First, paragraph 9 stated that "[n]o change or modification of any ordinance, code or regulations, shall be applied during the term of this agreement so as to affect the zoning classification or uses permitted thereunder of the subject property." Second, paragraph 14 stated that "[i]f development does not occur within five (5) years of annexation, the City has the right to zone the property to the `A' agriculture zoning district, to de-annex it, and/or to void the approved final plats." The property was not developed within the five-year period.
¶ 4 First Bank of Oak Park sold the property to Reserve in 2005. In 2003, prior to purchasing the property, Reserve had requested approval of a plat of 26 single-family lots. In 2004, the city plan commission voted to recommend denial of that plat and recommended to the city council that it rezone the property as agricultural. The city council did not act on the recommendation to rezone the property. In March 2004, the city attorney gave a written opinion that, in order for Reserve to proceed with the 26-lot development, the Annexation Agreement, which specifically referenced 20 lots, would have to be amended. On March 16, 2004, James Kastner, community development director of the City, reiterated to Reserve the position of the city attorney.
¶ 5 In May 2006, Reserve presented the City with a request for approval of a preliminary plat of subdivision (the plat) for 20 lots. Though the city plan commission recommended that the city council approve the plat, the city council denied approval of the plat on September 19, 2006. In October 2006, based on the City's denial of the plat, Reserve filed a complaint seeking declaratory, injunctive, and mandamus relief under the City's subdivision and platting *1105 ordinance (SPO). On November 21, 2006, the City passed an ordinance rezoning the property to an agricultural classification. In addition, the City passed an ordinance on December 5, 2006, repealing the SPO and replacing it with a new, comprehensive development ordinance, the unified development ordinance (UDO). On September 18, 2007, the City passed an ordinance disconnecting the property.

¶ 6 A. Third Amended Complaint
¶ 7 We begin with Reserve's third amended complaint, filed on October 11, 2007, which incorporated several counts from the second amended complaint. The complaint alleged as follows. After Reserve submitted a plat for City approval in May 2006, the "City staff" issued a report dated May 25, 2006, which stated that Reserve's plat complied with the relevant City ordinances and with the Annexation Agreement. At a meeting on May 25, 2006, the city plan commission considered the plat and requested an additional study on the hydrology of the property. Reserve then hired a hydrology consultant and at a substantial cost performed the study, which revealed no adverse impact on the property or surrounding property. On July 13, 2006, the city plan commission voted to recommend approval of the plat.
¶ 8 On August 1, 2006, the city council considered Reserve's application for plat approval. At that meeting, Mayor Brian Sager and the city attorney acknowledged that the property was zoned as residential property; that the application process had occurred properly; that the city plan commission had recommended approval; and that Reserve was in compliance with the City's ordinances. Nevertheless, the City council continued its deliberations and required Reserve to provide an additional study regarding the quality of well water and the quantity of storm water runoff. At this point, Reserve had expended "hundreds of thousands of dollars" and had invested substantial amounts of time in relation to the plat. At the next city council meeting, on September 5, 2006, the city council voted unanimously to reject the plat, despite again being presented with "unrefuted evidence" that the plat was fully compliant with the City's requirements. Two weeks later, on September 19, 2006, the City enacted an ordinance containing the City's "pretextual reasons" for denying Reserve's proposed plat. In particular, the City found that the plat failed to comply with three sections of the SPO, which pertained to protections of the physical amenities of adjacent properties, storm water management, and ground water/surface water contamination.
¶ 9 After Reserve filed its initial complaint challenging the "unlawful" denial of its plat, the city council held a hearing on a petition to rezone the property as agricultural. Though the city plan commission recommended denying the petition, the city council voted unanimously to rezone the property as agricultural.
¶ 10 The relevant counts of Reserve's third amended complaint were counts IV through VIII.[1] Counts IV, V, and VI (the *1106 plat compliance counts) challenged the City's denial of the plat, alleging that the plat complied with City ordinances. In particular, count IV sought a declaratory judgment that the plat conformed to all lawful and enforceable City ordinances. In count V, Reserve requested the court to issue a writ of mandamus ordering the City to approve the plat. Count VI sought an injunction enjoining the City from delaying approval of the plat.
¶ 11 Counts VII and VIII (the disconnection counts) challenged the City's ordinances rezoning the property as agricultural and disconnecting it from the corporate limits of the City. Count VII sought a declaratory judgment that the disconnection ordinance passed by the City was invalid, and it sought to enjoin the City from taking any further steps to disconnect the property. Count VIII sought a declaratory judgment that the Annexation Agreement did not allow the City to rezone the property or to disconnect it, and it sought to enjoin the City from taking any action to rezone the property. In addition, count VIII requested the court to enjoin the City from voiding any final plat that was in substantial compliance with City ordinances.

¶ 12 B. Motions and Trial Court Ruling
¶ 13 In October 2007, the City filed an amended affirmative defense, arguing that paragraph 14 of the Annexation Agreement gave it the right to rezone the property if it was not developed within five years of annexation, by May 18, 1998. The City also moved to dismiss Reserve's third amended complaint. Shortly thereafter, on November 8, 2007, Reserve moved for summary judgment as to counts IV through VIII of its third amended complaint.
¶ 14 The parties appeared in court on these motions on March 20, 2008. The court began by summarizing the parties' positions regarding the disconnection counts. The City argued that paragraph 14 of the Annexation Agreement gave it "absolute discretion to rezone, de-annex, and/or void the approved final plats of [Reserve] any time after May 1998 in the event the development of the property [had] not previously occurred on the subject property." Reserve countered the City's position by arguing that the language of paragraph 14 was overly broad, that it was not in harmony with other provisions of the Annexation Agreement, and that it violated the City's duty of good faith and fair dealing. In addition, Reserve argued that any right to rezone or disconnect the property had been waived under paragraph 9 of the Annexation Agreement, which stated that "[n]o change or modification of any ordinance, code or regulations, shall be applied during the term of this agreement so as to affect the zoning classification or uses permitted thereunder of the subject property."
¶ 15 The court then stated its ruling regarding the disconnection counts, denying the City's motion to dismiss and granting Reserve's motion for summary judgment. According to the court, paragraph 14 was not in harmony with other provisions of the Annexation Agreement because giving the City an unfettered right to invoke that provision could lead to absurd results, in that Reserve could invest thousands of dollars and begin building only to have the City surprise Reserve at the very end by asserting its right to de-annex pursuant to paragraph 14. Interpreting paragraph 14 in the strict literal sense could be "unconscionable," the court reasoned, because the City would be allowed to sit back and wait, to *1107 Reserve's detriment, and then surprise Reserve by exercising its rights. The court went on to say that, although the City had ample time to invoke paragraph 14 after 1998, it did not do so within a reasonable time. The court stated that, "[i]nstead, it waited until 2006 when [Reserve] may well have complied with all the ordinance [sic] and codes. Not wanting to approve the plats, it pulled its trump card of paragraph 14 and rezoned and disconnected the property." Noting that Reserve was never put on notice that the City intended to rezone or disconnect the property, the court concluded that the City had waived the provisions of paragraph 14, rendering the rezoning and disconnection ordinances invalid. Having found that the City's rezoning and disconnection of the property were invalid, the court granted summary judgment in favor of Reserve as to the disconnection counts.
¶ 16 Regarding the plat compliance counts, the court pointed out that the city plan commission had found that the plat complied with the applicable sections of the City's ordinances and with the Annexation Agreement. More importantly, the City was no longer disputing the plat's compliance with the SPO, which meant that the City was obligated to approve the plat. However, the court noted that the City had since repealed the SPO and replaced it with the UDO in December 2006. Recognizing that Reserve needed to prove compliance with the ordinance in effect at the time of the court's decision, not just at the time the City reviewed the plat, the court determined that it did not have sufficient information as to whether the plat complied with the UDO. Also, there was a question of fact as to whether Reserve had a vested right under the SPO to the plat's approval. As a result, the court denied Reserve's motion for summary judgment as to the plat compliance counts.
¶ 17 Approximately two months later, the parties advised the court that they needed a trial to resolve the plat compliance counts. Rather than try to show compliance with the UDO, Reserve proceeded with the limited issue of whether it had a vested right under the SPO to approval of its plat. A bench trial occurred on June 22, 2009, and each party presented the testimony of one witness. Due to a problem with the court's audio recording system, the parties filed a joint bystander's report, which provided as follows.
¶ 18 Thomas Loftus, one of Reserve's three principal members, testified as follows. Reserve was a company set up for developing residential and commercial property at a profit, and its sole asset was the subject property. Loftus testified that Reserve had previously prepared a plat for a 26-lot subdivision on the property. Based on the City's correspondence that the Annexation Agreement authorized a 20-lot subdivision, Reserve prepared a plat for a 20-lot subdivision in the spring of 2006. The plat was prepared according to the SPO. Loftus testified that City staff reviewed the plat and did not identify any issues regarding the plat's compliance with the SPO. The city plan commission reviewed the plat and recommended approval. In an ordinance dated September 19, 2006, the city council denied the plat. The City never indicated that compliance with the later-enacted UDO was a requirement for the plat.
¶ 19 Loftus testified regarding the expenses Reserve incurred to prepare the plat. The expenses included fees from a civil engineering firm ($11,529.48), fees for a hydrology study completed at the request of the City ($27,187.12), fees from a law firm ($5,525), fees for printing and copying the plat for submission ($819.18), fees for filing the plat ($4,365), and court reporting fees ($3,544.50), which totaled *1108 $52,970.28. Loftus testified that the City's request for a hydrology study was "highly unusual" and not made until after the plat was submitted. Loftus estimated that the cost to physically develop the property would be $440,000. Also, the costs of preparing a final plat would be comparatively less than the costs already incurred to prepare the preliminary plat. Loftus testified that he relied in good faith upon the SPO and believed that the City would approve the plat because it met all of the SPO's requirements.
¶ 20 On cross-examination, Loftus testified that, when Reserve purchased the property in 2005, he was aware that the property was subject to an Annexation Agreement. In addition, no City official told Loftus that the plat would be approved.
¶ 21 James Kastner testified on behalf of the City. Kastner was the planning and zoning administrator for the City, and he had about 28 years of experience in the field of planning and zoning. Kastner reviewed Reserve's plat for conformity with the SPO. At no time during the process "from submission of the plat to the City's vote on the plat" did Kastner advise Reserve that there was a likelihood that the City would approve the plat. Kastner authored two memoranda stating that the plat complied with the SPO and the Annexation Agreement, and he agreed that the plat so complied. Kastner did not prepare the City ordinance that rejected Reserve's plat. Kastner testified that the SPO had been amended by the City's adoption of the UDO in December 2006. Kastner reviewed the plat for compliance with the UDO, and the plat did not comply with multiple sections of that ordinance.

¶ 22 C. Fourth Amended Complaint Adds Quo Warranto Count
¶ 23 On July 20, 2009, the City moved for reconsideration of the court's denial of its motion to dismiss. According to the City, the court lacked authority to void the City's disconnection of the property. Relying on a recent case decided by the Second District, Village of Montgomery v. Aurora Township, 387 Ill.App.3d 353, 326 Ill.Dec. 350, 899 N.E.2d 567 (2008), the City argued that the exclusive mechanism for challenging the validity of a disconnection or annexation was a quo warranto proceeding. Because Reserve's third amended complaint was not styled as a quo warranto action, the City argued that the court lacked jurisdiction to invalidate the ordinance disconnecting the property. The trial court granted the City's motion to reconsider and dismissed the disconnection counts of Reserve's third amended complaint. The court then granted Reserve leave to file a fourth amended complaint to add a count for quo warranto relief.
¶ 24 On September 14, 2009, Reserve filed a fourth amended complaint, which incorporated the third amended complaint and added one count, count IX, for quo warranto relief. As before, Reserve argued that paragraph 9 of the Annexation Agreement prevented the City from disconnecting the property. The City moved to dismiss Reserve's fourth amended complaint, and the court conducted a hearing on the motion. The parties disputed whether quo warranto relief was the only means of challenging the disconnection. To this end, Reserve argued that its request for a declaratory judgment invalidating the disconnection was still a valid claim. The City responded that, not only was Reserve limited to a quo warranto action, but Reserve could not prevail in such an action because the City had authority to disconnect the property under paragraph 14 of the Annexation Agreement. The court denied the City's motion to dismiss.
*1109 ¶ 25 At this point, the parties discussed how to proceed on the various counts of Reserve's fourth amended complaint. A bench trial had already occurred on the plat compliance counts to determine whether Reserve had a vested right to approval of its plat under the SPO as opposed to the recently enacted UDO. The trial court had not yet ruled on those counts, and the parties agreed that those counts were on hold depending on the validity of the City's disconnection of the property. In other words, the parties and the court recognized that, if the disconnection was in fact lawful, then that would be the end of the case, meaning that the plat compliance counts would become moot.
¶ 26 On April 6, 2010, Reserve moved for summary judgment as to the disconnection and quo warranto counts of its fourth amended complaint. Regarding the plat compliance counts, Reserve asked the court to enter judgment in its favor.
¶ 27 On June 7, 2010, the trial court granted summary judgment in favor of Reserve as to the disconnection and quo warranto counts. In granting summary judgment as to all three counts, the court noted that the factual issues underlying the disconnection were the same, and it declined to decide whether quo warranto relief or declaratory relief was the proper method of challenging the disconnection. The court also entered judgment in favor of Reserve as to the plat compliance counts. According to the court, it was undisputed that, when Reserve submitted its plat, it complied with the SPO, and the City had "absolutely no reason to deny" it. In terms of a vested right, the court "believe[d]" that Reserve had sustained its burden of showing that it acted in good-faith reliance on the probability of obtaining the necessary approvals to develop the property. In addition, based on the totality of the circumstances, the court found that Reserve's expenditures were substantial. Recognizing that there was no formula per se for determining whether expenditures were substantial, the court stated that it considered various factors, such as a comparison of the expenses incurred versus the estimated total project cost, the cost of the land, and the character of the entity, in concluding that Reserve possessed a vested right.
¶ 28 The City timely appealed.

¶ 29 II. ANALYSIS

¶ 30 A. Disconnection and Quo Warranto Counts
¶ 31 We begin by considering the propriety of the trial court's grant of summary judgment in favor of Reserve as to counts VII, VIII, and IX, which challenged the disconnection and rezoning of the property as agricultural. We begin with those counts because, as the trial court recognized, the validity of the disconnection controls whether we need reach counts IV, V, and VI pertaining to plat compliance.
¶ 32 "Summary judgment is proper if, when viewed in the light most favorable to the nonmoving party, the pleadings, depositions, admissions, and affidavits on file demonstrate that there is no genuine issue as to any material fact and that the moving party is entitled to judgment as a matter of law." Lazenby v. Mark's Construction, Inc., 236 Ill.2d 83, 93, 337 Ill.Dec. 884, 923 N.E.2d 735 (2010). Our review of a trial court's grant of summary judgment is de novo. Id.

¶ 33 1. Quo Warranto

¶ 34 At the outset, the City argues that quo warranto is the exclusive form of relief available to Reserve to challenge the disconnection. Section 18-101 of the Code of Civil Procedure (735 ILCS 5/18-101 (West 2006)) provides the grounds upon which a quo warranto action may be *1110 brought. Subsection (5) states that a quo warranto action may be brought where "[a]ny corporation does or omits to do any act which amounts to a surrender or forfeiture of its rights and privileges as a corporation, or exercises powers not conferred by law." 735 ILCS 5/18-101(5) (West 2006). The term "corporation" has been deemed to include municipal corporations. People ex rel. Ryan v. Village of Hanover Park, 311 Ill.App.3d 515, 521, 243 Ill.Dec. 823, 724 N.E.2d 132 (1999). In arguing that quo warranto is the sole remedy available to Reserve, the City relies on Village of Montgomery, 387 Ill.App.3d at 362, 326 Ill.Dec. 350, 899 N.E.2d 567, in which this court held that "[q]uestions of whether parcels have been legally disconnected or annexed can be tried only by quo warranto proceedings and cannot be raised collaterally." (Emphasis added.) We note that other cases have held similarly. See East Side Fire Protection District v. City of Belleville, 221 Ill.App.3d 654, 655, 164 Ill.Dec. 192, 582 N.E.2d 755 (1991)(quo warranto is the only proper remedy for questioning the validity of an annexation that has been accomplished, and a declaratory judgment action is not a concurrent remedy); Department of Illinois Disabled American Veterans v. Bialczak, 38 Ill.App.3d 848, 850-51, 349 N.E.2d 897 (1976) (noting that in certain instances quo warranto has been held to exclude other remedies; for example, quo warranto has unequivocally been granted exclusive status in testing the validity of annexation proceedings).
¶ 35 The City wants to limit Reserve to quo warranto relief because it wants to limit the grounds upon which Reserve can challenge the disconnection. As the City points out, quo warranto proceedings are limited: the proper scope of a quo warranto proceeding is to challenge the authority to act, not the manner of exercising authority. McCready v. Secretary of State, 382 Ill.App.3d 789, 801, 321 Ill.Dec. 183, 888 N.E.2d 702 (2008); see also People ex rel. Citizens for a Better Bloomingdale v. Village of Bloomingdale, 37 Ill.App.3d 583, 587, 346 N.E.2d 5 (1976) (the question is not how the village officials exercised the power but whether the village had the right to exercise the power). According to the City, Reserve's challenge to the disconnection is in reality "a challenge to the timeliness and equity of the manner in which the City exercised its remedies and rights" under the Annexation Agreement, which is outside the scope of a permissible challenge in a quo warranto action.
¶ 36 While this argument seems convincing at first, the case at bar does not fit neatly within the contours of a quo warranto action. On the one hand, we agree with the City that a complaint in quo warranto may be used to challenge a completed annexation or disconnection pursuant to an annexation agreement, which was the basis under which the City disconnected the property here. On the other hand, a quo warranto action must still be based on a municipality's right or authority to act rather than on its discretionary acts. For example, in Village of Bloomingdale, 37 Ill.App.3d at 584-85, 346 N.E.2d 5, the plaintiffs requested leave to file a complaint in quo warranto based on the village's decision to enter into an annexation agreement that annexed over 800 acres of contiguous territory. The trial court denied the plaintiffs' request, and the appellate court affirmed, reasoning that the plaintiffs' attack was not upon the legality of the annexation or the annexation agreement, but instead upon the advisability and wisdom of the village in entering into the agreement itself. Id. at 586, 346 N.E.2d 5. The court concluded that the exercise of the village's "discretion in the performance *1111 of its authorized powers was not subject to challenge by quo warranto and that the application was properly denied." Id. at 587, 346 N.E.2d 5. Later, in People ex rel. Ryan v. City of West Chicago, 216 Ill. App.3d 683, 690, 159 Ill.Dec. 261, 575 N.E.2d 1321 (1991), the court reiterated that a quo warranto complaint may be an appropriate means of challenging an annexation agreement, as opposed to an annexation. However, the court noted that the challenge to the annexation agreement in that case was to the City of West Chicago's promise to do something that it was not empowered to do under the law. Id. In holding that the plaintiffs' complaint was a proper complaint in quo warranto, the court clarified that the challenge was not "to discretionary actions" taken by the City of West Chicago, but instead to the City of West Chicago's authority to take certain actions as required by the annexation agreement. Id. at 691, 159 Ill.Dec. 261, 575 N.E.2d 1321.
¶ 37 In this case, Reserve's challenge to the disconnection necessarily depends on the interpretation of the Annexation Agreement, specifically the City's "discretion" to rezone and disconnect the property under paragraph 14. A similar issue arose in Elm Lawn Cemetery Co. v. City of Northlake, 94 Ill.App.2d 387, 390, 237 N.E.2d 345 (1968), where the City of Northlake argued that the only way to attack the validity of an annexation ordinance was by a quo warranto action. In rejecting that argument, the court noted that the plaintiff's complaint in that case did not question the legality of the annexation ordinance but, rather, sought to have "a declaration that the preannexation agreement and the ordinance [were] to be deemed null and void since certain events [required by the agreement] did not occur." Id. Given the nature of the challenge, the court determined that the plaintiff was allowed to proceed by way of a declaratory judgment action, which was not designed to supplant existing remedies but was an alternative or additional remedy to facilitate the administration of justice. Id. at 391-92, 237 N.E.2d 345. We agree with the reasoning in Elm Lawn Cemetery Co. and find that quo warranto was not the only action available to Reserve to challenge the disconnection in this case. See id. at 390-91, 237 N.E.2d 345. Because Reserve's challenge centers on the interpretation of the Annexation Agreement, and specifically the City's exercise of discretion under paragraph 14, it was proper for Reserve to seek declaratory relief in this case.

¶ 38 2. Interpretation of Annexation Agreement
¶ 39 In interpreting the Annexation Agreement, the basic rules of contract interpretation apply. See First Bank & Trust Co. of Illinois v. Village of Orland Hills, 338 Ill.App.3d 35, 40, 272 Ill.Dec. 485, 787 N.E.2d 300 (2003) (applying basic rules of contract interpretation to an annexation agreement). In construing a contract, the primary objective is to give effect to the intent of the parties, and a court will first look to the language of the contract itself to determine the parties' intent. Thompson v. Gordon, 241 Ill.2d 428, 441, 349 Ill.Dec. 936, 948 N.E.2d 39 (2011). A contract must be construed as a whole, viewing each provision in light of the other provisions. Id. The parties' intent is not ascertained by viewing a clause or provision in isolation, or by looking at detached portions of the contract. Id.; see also Hot Light Brands, L.L.C. v. Harris Realty, Inc., 392 Ill.App.3d 493, 499, 332 Ill.Dec. 72, 912 N.E.2d 258 (2009) (an agreement is to be interpreted as a whole; we should give meaning and effect to every provision when possible, and we will not interpret the agreement in a way that would nullify provisions or would render *1112 them meaningless). Furthermore, if the words in the contract are clear and unambiguous, they must be given their plain, ordinary, and popularly understood meaning. Thompson, 241 Ill.2d at 441, 349 Ill.Dec. 936, 948 N.E.2d 39. A contract is not ambiguous merely because the parties disagree on its meaning; ambiguity exists where language is obscure in meaning through indefiniteness of expression. Hot Light Brands, 392 Ill.App.3d at 499, 332 Ill.Dec. 72, 912 N.E.2d 258.
¶ 40 The two relevant provisions of the Annexation Agreement are paragraphs 9 and 14. Paragraph 9 states:
"No change or modification of any ordinance, code or regulations, shall be applied during the term of this agreement so as to affect the zoning classification or uses permitted thereunder of the subject property. Except as modified by the terms and provisions of this agreement, the developer shall comply in all respects with the conditions and requirements of all ordinances of the City in existence [sic] at the time of annexation or the issuance of building permits, whichever is later."
Paragraph 14 states:
"In the event that the developer does not acquire title to the property, this annexation agreement and petition for annexation shall be considered null and void and the said parcel shall be considered de-annexed from the City of Woodstock. If development does not occur within five (5) years of annexation, the City has the right to zone the property to the `A' agriculture zoning district, to de-annex it, and/or to void the approved final plats."
¶ 41 Both the City and Reserve rely on one sentence in each paragraph to support their relative positions. Reserve argues that under paragraph 9 the City was prohibited from rezoning the property or from passing an ordinance disconnecting it until the expiration of the 20-year term, in May 2013. Conversely, the City argues that paragraph 14 gave it an ongoing right to rezone or de-annex the property after the five-year window for development expired, meaning that the City could exercise these rights at any time during the remaining 15 years. The City argues that the Annexation Agreement contains no term limiting its right to disconnect the property, whereas Reserve counters that paragraph 9, with its prohibition on rezoning or disconnection, also runs for the duration of the agreement. Reserve thus argues that there is a conflict between paragraphs 9 and 14 and that, in order to resolve this conflict, the scope of the City's discretion under paragraph 14 must be construed in light of the principles of good faith and fair dealing. Because paragraphs 9 and 14 allow for conflicting interpretations, we agree with Reserve that we may use the duty of good faith and fair dealing as a construction aid in determining the intent of the parties. See Seip v. Rogers Raw Materials Fund, L.P., 408 Ill.App.3d 434, 443, 350 Ill.Dec. 348, 948 N.E.2d 628 (2011) (the duty of good faith and fair dealing is used as a construction aid in determining the intent of the parties where an instrument is susceptible of two conflicting constructions).
¶ 42 "The duty of good faith and fair dealing is implied in every contract and requires a party vested with contractual discretion to exercise it reasonably, and not arbitrarily, capriciously, or in a manner inconsistent with the reasonable expectations of the parties." Seip, 408 Ill.App.3d at 443, 350 Ill.Dec. 348, 948 N.E.2d 628. The purpose of this duty "is to ensure that parties do not take advantage of each other in a way that could not have been contemplated at the time the contract was drafted or do anything that *1113 will destroy the other party's right to receive the benefit of the contract." Gore v. Indiana Insurance Co., 376 Ill.App.3d 282, 286, 315 Ill.Dec. 156, 876 N.E.2d 156 (2007). Disputes involving the exercise of good faith arise when one party is given broad discretion in performing its obligations under the contract. Id.; see also Citicorp Savings of Illinois v. Rucker, 295 Ill.App.3d 801, 808, 230 Ill.Dec. 153, 692 N.E.2d 1319 (1998) (the duty of good faith and fair dealing requires the party vested with contractual discretion not to injure the other party to the contract by action or omission and not to act inconsistently with the other party's rights).
¶ 43 In this case, Reserve argues that the City's actions in not exercising its rights under paragraph 14 until the commencement of the present litigation violated its duty of good faith and fair dealing. The facts reveal that the City did nothing to exercise its rights under paragraph 14 from 1998, when the five-year development window expired, to 2006, when Reserve submitted its preliminary plat. After Reserve completed a hydrology study at its own expense at the city plan commission's request, the city plan commission recommended that the city council approve the plat. Indeed, in considering the plat, the city council noted that the plat complied with the Annexation Agreement and had proceeded appropriately through the process for obtaining approval. Later, the City even conceded that the plat complied with the SPO.
¶ 44 As the trial court reasoned, interpreting paragraph 14 to allow the City to sit back and wait, to Reserve's detriment, and then surprise Reserve by playing its "trump card" in the eleventh hour defied reasonable expectations. Under the City's interpretation, Reserve could jump through all of the hoops for complying with City ordinances such as the SPO, and reach the stage for approval of its final plat, only to have the City decide at the very end to deny the final plat, rezone the property, and disconnect it. Furthermore, although the City had discussed the possibility of rezoning the property in 2004, before Reserve purchased it in 2005, we agree with the trial court that Reserve was never put on notice that the City still intended to rezone or disconnect the property. The City's actions in doing so at this late date were unreasonable, especially in light of the language in paragraph 9 preventing such actions.
¶ 45 Given the conflicting language in the Annexation Agreement, as to the City's limited rights in paragraph 9 and its unfettered discretion in paragraph 14, we hold that the City's actions of rezoning and disconnecting the property violated its duty of good faith and fair dealing. We make this finding as a matter of law, given that there is no genuine issue as to any material fact. See St. Mary's Hospital, Decatur v. Health Personnel Options Corp., 309 Ill.App.3d 464, 470, 242 Ill.Dec. 682, 721 N.E.2d 1213 (1999) (applying summary judgment to the claim that the defendant corporation breached its implied duty of good faith and fair dealing). We note that, technically, the trial court granted summary judgment on the basis that the City had waived its rights under paragraph 14. However, we may sustain the court's decision on any grounds that are called for by the record, regardless of whether they were relied on by the trial court. See First Chicago Insurance Co. v. Molda, 408 Ill.App.3d 839, 845, 350 Ill.Dec. 137, 948 N.E.2d 206 (2011). Therefore, the trial court properly entered summary judgment in favor of Reserve as to counts VII and VIII seeking declaratory relief, thus rendering the rezoning and disconnection ordinances invalid. Because the quo warranto count seeks the same relief *1114 as counts VII and VIII, that count is rendered moot.

¶ 46 B. Plat Compliance Counts
¶ 47 Our final task is to address the trial court's entry of judgment in favor of Reserve as to counts IV, V, and VI. Count IV sought a declaratory judgment that the plat conformed to all lawful and enforceable City ordinances; count V requested the court to issue a writ of mandamus ordering the City to approve the plat; and count VI sought an injunction enjoining the City from delaying approval of the plat. In analyzing the propriety of the court's judgment in favor of Reserve, we keep in mind two undisputed facts. First, that the plat submitted by Reserve failed to comply with the UDO, which was enacted after Reserve submitted its plat. Second, that Reserve's plat was in compliance with the SPO, which was in existence when the plat was submitted. Therefore, the limited issue common to all three counts is whether Reserve possessed a vested right under the SPO to approval of its plat. See 1350 Lake Shore Associates v. Randall, 401 Ill.App.3d 96, 102, 340 Ill.Dec. 462, 928 N.E.2d 181 (2010) (the vested-right doctrine provides an exception to the general rule that a property owner has no vested right in the continuation of a zoning classification).

¶ 48 1. Standard of Review
¶ 49 Before analyzing whether Reserve met its burden of establishing a vested right, we set forth the standard of review. Beginning with count IV for declaratory judgment, the standard of review depends on the nature of the proceedings in the trial court:
"`[W]hether 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 [such as the admissibility of evidence, credibility determinations, and the weighing of conflicting evidence], and only to those decisions. When we are reviewing a type of decision that the trial court was better qualified to make, we must proceed with due recognition of the trial court's superior vantage point.'" Pekin Insurance Co. v. Hallmark Homes, L.L.C., 392 Ill.App.3d 589, 593, 332 Ill. Dec. 64, 912 N.E.2d 250 (2009) (quoting In re Marriage of Rife, 376 Ill.App.3d 1050, 1058-59, 316 Ill.Dec. 53, 878 N.E.2d 775 (2007)).
To the extent that the trial court's decision in a declaratory judgment action is not based on factual determinations, our review is de novo. Id.
¶ 50 The City argues that we should review this issue de novo because it involves interpretation of the Annexation Agreement and because the facts are undisputed. We are not persuaded. As stated, the underlying issue of the declaratory judgment action is whether Reserve possessed a vested right under the SPO to approval of its plat. The appropriate standard of review for this issue is whether the trial court's decision is against the manifest weight of the evidence (see Furniture L.L.C. v. City of Chicago, 353 Ill.App.3d 433, 437, 288 Ill.Dec. 904, 818 N.E.2d 839 (2004)), not de novo review. Given that there was a trial on the vested-rights issue that naturally involved credibility determinations, weighing evidence based on the totality of the circumstances, and factual questions regarding good-faith reliance and whether expenses were substantial, this is the type of trial court decision entitled to deferential review. Accordingly, we review the trial court's grant of a declaratory judgment on this count under the deferential abuse-of-discretion standard of *1115 review. See Pekin Insurance Co., 392 Ill. App.3d at 592, 332 Ill.Dec. 64, 912 N.E.2d 250.
¶ 51 Regarding count V, a writ of mandamus is an extraordinary remedy traditionally used to compel a public officer's performance of an official duty that does not involve an exercise of discretion. Randall, 401 Ill.App.3d at 102, 340 Ill.Dec. 462, 928 N.E.2d 181. Generally, the decision to grant or deny a writ of mandamus will not be disturbed on appeal unless it is against the manifest weight of the evidence. Id. A decision is against the manifest weight of the evidence when the opposite conclusion is clearly evident or where the factual findings upon which it is based are unreasonable, arbitrary, or not based on the evidence. Id. As with the declaratory judgment count, the City again argues for de novo review. For the reasons stated above, the trial court's decision in a vested-rights inquiry is entitled to deference, meaning that the de novo standard of review is not appropriate. Therefore, we apply the manifest-weight-of-the-evidence standard, which is typically applied in mandamus cases.
¶ 52 Finally, a party seeking a permanent injunction, as in count VI, must show that he has a clear and ascertainable right that needs protection, there is no adequate remedy at law, and he will suffer irreparable harm if injunctive relief is not granted. Helping Others Maintain Environmental Standards v. Bos, 406 Ill. App.3d 669, 688, 346 Ill.Dec. 789, 941 N.E.2d 347 (2010). Consistent with the other counts, the City urges us once again to apply de novo review. However, as we have explained, this case does not involve pure questions of law. As a result, there is no reason to deviate from the abuse-of-discretion standard of review usually applied when reviewing the grant of a permanent injunction. See Christian Assembly Rios de Agua Viva v. City of Burbank, 408 Ill.App.3d 764, 768, 350 Ill.Dec. 182, 948 N.E.2d 251 (2011).

¶ 53 2. Vested-Rights Doctrine
¶ 54 Turning now to the vested-rights doctrine, our supreme court has stated:
"`[W]here there has been a substantial change of position, expenditures or incurrence of obligations made in good faith by an innocent party under a building permit or in reliance upon the probability of its issuance, such party has a vested property right and he may complete the construction and use of the premises for the purposes originally authorized, irrespective of subsequent zoning or a change in zoning classification.'" 1350 Lake Shore Associates v. Healey, 223 Ill.2d 607, 615, 308 Ill.Dec. 379, 861 N.E.2d 944 (2006) (quoting People ex rel. Skokie Town House Builders, Inc. v. Village of Morton Grove, 16 Ill.2d 183, 191, 157 N.E.2d 33 (1959)).
The purpose of the vested-rights doctrine is to mitigate the unfairness caused by a zoning change after a property owner has undergone a substantial change of position in good-faith reliance on the prior zoning classification. Randall, 401 Ill.App.3d at 103, 340 Ill.Dec. 462, 928 N.E.2d 181. Under this doctrine, a property owner may acquire a vested right in a prior zoning classification where the owner sustained a significant change of position, by either making substantial expenditures or incurring substantial obligations, in good-faith reliance upon the probability of the issuance of a building permit. Id. at 102, 340 Ill.Dec. 462, 928 N.E.2d 181. Whether a property owner has acquired a vested right in a former zoning classification depends upon two factors: first, it must be determined which of the expenditures made or obligations incurred were done in *1116 good-faith reliance on the probability that the property owner would obtain the necessary approvals to develop the property pursuant to the prior zoning classification; and second, it must be determined whether those expenditures or obligations were substantial. Id. at 103, 340 Ill.Dec. 462, 928 N.E.2d 181.
¶ 55 In terms of good-faith reliance, the City argues that Reserve cannot establish this prong because Reserve was aware of the City's rights under paragraph 14 of the Annexation Agreement. The City goes as far as saying that, from the moment Reserve purchased the property, it never had the right to develop it given the City's rights to rezone, de-annex, or void a final plat. In addition, the City argues that Reserve was aware of the possibility that the property could be rezoned as agricultural since 2004, when the city plan commission recommended that the city council take such action. Based on this evidence, the City concludes that Reserve failed to show that it incurred expenses in good-faith reliance on the probability that the plat would be approved.
¶ 56 As a preliminary matter, we note that there is no bright-line test for determining whether a party's expenditures have been made in good-faith reliance on the probability that a building permit will issue. Furniture L.L.C., 353 Ill.App.3d at 437, 288 Ill.Dec. 904, 818 N.E.2d 839. Beginning with the City's argument that its rights under paragraph 14 of the Annexation Agreement defeated Reserve's good-faith reliance, we disagree. Our supreme court has stated:
"[W]hen considering whether a property owner has gained a vested right to build under the property's then-existing zoning classification, the starting point for the analysis must be the point at which some official action took place that could result in a change in the property's zoning. At a minimum, this would require actual introduction of a proposal to the appropriate zoning authorities which, if enacted into law, would change the property's existing zoning to a classification that would not allow construction of the property owner's building project." (Emphasis added.) Healey, 223 Ill.2d at 622, 308 Ill.Dec. 379, 861 N.E.2d 944.
In other words, the "mere fact that the landowner was aware that the zoning ordinance might be amended does not preclude its expenditures from being in good faith, as would support its vested-rights argument." (Emphasis added.) Christian Assembly Rios de Agua Viva, 408 Ill.App.3d at 771, 350 Ill.Dec. 182, 948 N.E.2d 251. Essentially, the City argues that the starting point at which Reserve knew or should have known that the plat would not be approved was in 1998, after the five-year window for development expired. But even if we were to assume for argument's sake that paragraph 14 did give the City an unfettered right to rezone and disconnect the property for the remainder of the 20-year term, this language created only the possibility of rezoning; it did not amount to official action that could result in a change in the property's zoning. No official action changing the zoning of the property was taken until six months after Reserve submitted its plat to the City, and two months after the plat was denied. Therefore, we reject the City's argument that the language in paragraph 14 destroyed Reserve's good-faith reliance.
¶ 57 Arguably, the city plan commission's recommendation to the city council in 2004 that the property be rezoned as agricultural was the type of official action that could result in a change to the property's zoning. However, the problem here is that the city council never acted on that recommendation and the property remained *1117 zoned as residential. When analyzing good-faith reliance, a probability that municipal approval is forthcoming exists when the property at issue is currently zoned to permit the use requested by the property owner. Christian Assembly Rios de Agua Viva, 408 Ill.App.3d at 769, 350 Ill.Dec. 182, 948 N.E.2d 251. In this case, the property remained zoned as residential at all relevant times. And, as previously mentioned, paragraph 9 of the Annexation Agreement prohibited the City from changing that zoning classification.
¶ 58 The time line shows that as early as 2003, prior to purchasing the property, Reserve attempted to develop it by proposing a 26-lot subdivision. In 2004, the City responded that the Annexation Agreement referenced 20 lots and would have to be amended. Reserve then purchased the property in 2005, and in 2006, it proposed a 20-lot subdivision, in conformance with the Annexation Agreement. Therefore, when Reserve presented the plat at issue, the zoning was still residential. This critical fact separates the instant case from Bank of Waukegan v. Village of Vernon Hills, 254 Ill.App.3d 24, 193 Ill.Dec. 212, 626 N.E.2d 245 (1993), on which the City relies. In Bank of Waukegan, the annexation agreement that created certain zoning and special use permits had expired. Id. at 25, 193 Ill.Dec. 212, 626 N.E.2d 245. As a result, the court held that there was no probability that municipal approval would issue because the property was no longer subject to a special use for planned-unit development when the developers sought to obtain approval for their apartment-complex plans. Id. at 31, 193 Ill.Dec. 212, 626 N.E.2d 245.
¶ 59 Given that the Annexation Agreement was still in effect when Reserve submitted its plat; that the property was still zoned as residential; that paragraphs 9 and 14 of the Annexation Agreement were in conflict; and that the city plan commission found that the plat complied with the SPO and voted to recommend approval of the plat, the trial court's finding that Reserve acted in good-faith reliance was not against the manifest weight of the evidence.
¶ 60 The next issue is whether Reserve's expenditures were substantial. Factors to consider in a substantiality analysis include: a comparison of the amount spent with the projected costs of the development; the nature or character of the person or entity seeking to develop the property; and the cost of the land. Healey, 223 Ill.2d at 625, 627, 308 Ill.Dec. 379, 861 N.E.2d 944. Our supreme court has stated that "[t]here may, as well, be other factors in individual cases that a court may properly consider. None of these factors should be viewed in isolation; rather, * * * it is the totality of the circumstances that will determine whether expenditures in any given case are deemed to be substantial." Id. at 627, 308 Ill.Dec. 379, 861 N.E.2d 944.
¶ 61 The trial court stated that it reviewed the above factors in determining that Reserve's expenditures were substantial, and the evidence supported the trial court's finding. Loftus, Reserve's principal member, testified that Reserve incurred $52,970.28 in expenses related to the plat. He also estimated that the cost to physically develop the property would be $440,000. While the City argues that Loftus' $440,000 figure failed to encompass the total cost of the development, such as the actual building costs, the trial court stated that it compared the expenses incurred with "the total project cost." The expenses incurred included a hydrology study, which Loftus found "highly unusual." This study alone, which was completed at the request of the city plan commission, cost Reserve $27,187.12. The court *1118 stated that it also considered the cost of the land, although we did not find that information in the record. Next, the court considered Reserve's character, and the evidence showed that the property at issue was Reserve's sole asset. To put the cost of the preliminary plat in perspective, Loftus testified that the cost of developing the final plat would be comparatively less than the cost already incurred to prepare the preliminary plat. For all of these reasons, we cannot say that the trial court's finding that Reserve's expenditures were substantial was against the manifest weight of the evidence.
¶ 62 Because the trial court's finding that Reserve possessed a vested right under the SPO to approval of its plat was not against the manifest weight of the evidence, we affirm the court's judgment as to counts IV, V, and VI. As previously mentioned, count IV sought a declaratory judgment that the plat conformed to all lawful and enforceable City ordinances; count V requested the court to issue a writ of mandamus ordering the City to approve the plat; and count VI sought an injunction enjoining the City from delaying approval of the plat.

¶ 63 III. CONCLUSION
¶ 64 For the reasons stated, we affirm the judgment of the circuit court of McHenry County granting judgment in favor of Reserve as to counts IV, V, and VI and granting summary judgment in favor of Reserve as to counts VII and VIII.
¶ 65 Affirmed.
Presiding Justice Jorgensen and Justice McLaren concurred in the judgment and opinion.
NOTES
[1]  Count I, which alleged that the doctrines of laches and estoppel barred the City from rezoning the property as agricultural, had already been dismissed by the trial court at this point. The court dismissed count I because laches was an affirmative defense, as opposed to a cognizable cause of action, and because Reserve had failed to plead the requisite elements of "equitable estoppel." Though Reserve was given leave to replead that count, it never amended the count. Counts II and III, which sought a declaratory judgment and an injunction to set aside the City's rezoning of the property as agricultural, were eventually rendered moot after the court ruled on Reserve's fourth amended complaint. Counts I, II, and III were incorporated into Reserve's third and fourth amended complaints but are not at issue on appeal.
