Appeal from the Circuit Court of Cook County. No. 02 CH 14497 Honorable Thomas P. Quinn, Judge Presiding.
 The opinion of the court was delivered by: Justice Greiman
 The plaintiffs, Nikola and Maryann Kovilic (the Kovilics), filed a two-count complaint for declaratory judgment and for other relief against the defendant, the City of Chicago (City). Count I sought a determination of the parties' rights and interests in a building at 5642 South Central Avenue, Chicago, Illinois, based upon common law property principles. Count II sought damages for unjust enrichment. In response, the City filed a hybrid motion to dismiss based upon sections 2-615 and 2-619 of the Illinois Code of Civil Procedure. 735 ILCS 5/ 2-615, 2-619 (West 2000). Following a hearing, the trial court granted the defendant's motion and dismissed the complaint. The Kovilics now appeal and, for the reasons that follow, we affirm.
 This case involves a dispute over ownership of a building, which was designed, paid for, and constructed by the plaintiffs on land owned by the City. On December 14, 1990, the property upon which the plaintiffs built the building became the subject of a written lease between the City and the Federal Aviation Administration (FAA). Under that lease, the FAA rented the subject property from the City, and in consideration for its use of the land, the FAA was to operate and maintain air navigational facilities "on and for" Midway Airport and pay rent to the City at the rate of $1 per year. The lease also provided that the FAA, at its option, could terminate the lease "at any time" by giving at least 30 days' notice to the City. Otherwise, when the initial term of the lease ended on September 30, 1991, the lease would renew automatically for 38 successive one-year terms, the last to expire on September 30, 2029.
 Article 1(c) of the lease authorized the FAA "to make alterations, attach fixtures, and erect additions, structures or signs" on the City's property, and provided that such items "shall be and remain the property of the [FAA], and may be removed upon the date of expiration or termination of this lease, or within 90 days thereafter." In the event that City opted to have such additions and structures removed from its property at the conclusion of the lease, article 5 of the lease also provided that the City, at its option, could give notice to the FAA "request[ing] restoration of the premises." If the City gave such notice, the FAA would become obligated, not later than 90 days after expiration or termination of the lease, either to "restore the premises to as good condition as that existing" at the lease's inception, or pay the City "the cost of such restoration of the premises or the diminution of the value of the premises if unrestored, whichever is less."
 In January of 1991, the FAA asked the plaintiffs, who are general construction contractors, to submit a bid for the design and construction of a building on the leased premises. The FAA's letter to the plaintiffs indicated that the FAA had a "land lease for the building site," and that the City was the lessor and the FAA was the lessee under that lease.
 The FAA accepted the plaintiffs' bid, and the parties then executed a contract to memorialize their agreement. Specifically, the contract provided that the plaintiffs were to construct the building at their own expense, which they did, and that the FAA would lease the building from the plaintiffs and pay yearly rent installments. The contract was set initially for a one-year term ending on September 30, 1992, and would renew automatically for 19 successive one-year terms unless the FAA, at its option, notified the plaintiffs at the end of a term that it no longer wished to renew the contract. The contract also specified that the rent would be $120,120 for the initial term and $128,700 for each renewal term, and that "[a]t the end of the 19th renewal term and upon termination of the lease, title to the improvements constructed by the [plaintiffs] upon the premises shall pass from the [plaintiffs] to the FAA via a Bill of Sale." However, the contract also stated that if the contract expired between the FAA and the plaintiffs because the FAA did not renew it, the FAA "shall assign" the City - FAA land lease to the plaintiffs.
 After the building was completed, the FAA moved in and began paying rent to the plaintiffs. In a letter to the City dated September 30, 1993, Maryann Kovilic asked the City to agree to an assignment of the City - FAA land lease to the plaintiffs in the event that the FAA decided not to renew the FAA - Kovilics building contract. The City responded by informing the plaintiffs' counsel that it would not agree to such an assignment. However, in a letter to the City dated February 17, 1995, plaintiffs' counsel again expressed his clients' interest in buying the land from the City. Again, the City declined the plaintiffs' offer.
 On October 7, 1997, the FAA and the plaintiffs entered into a new written lease under which the FAA rented only a portion of the building from the plaintiffs for $1,250 per month. That lease, however, contained no provision concerning the FAA's assignment of the City - FAA land lease to the plaintiffs. The new Kovilic - FAA lease was for a fixed term that expired on September 30, 2000. Apparently, the FAA did not leave the building by that expiration date, although it did leave the building by July 30, 2001.
 Thereafter, the FAA terminated its land lease with the City, effective March 8, 2002. In the letter terminating that lease, the FAA released all of its "leasehold rights" in the parcel of land, and in a notarized "Release of Leasehold Interest" accompanying the letter, likewise "surrendered" such rights to the City. On March 22, 2002, the City advised the plaintiffs that, upon termination of the land lease, the building had become property of the City. On May 8, 2002, the City advised the plaintiffs that it had changed the locks and barred the plaintiffs from the building.
 Within 90 days of the City - FAA lease termination, the building still remained upon the property. In that regard, the City wrote a letter to the FAA on August 9, 2002, stating that "more than 90 days ha[ve] now passed from the date the FAA terminated the [land] lease and the City is now in sole ownership and possession of the improvements that were installed upon the premises." The plaintiffs, however, informed the City that, in their view, they own the building. Accordingly, on August 10, 2002, the plaintiffs filed their complaint for a judgment declaring them rightful owners the building and for monetary damages based upon a claim of unjust enrichment.
 On November 1, 2002, the City filed its motion to dismiss under sections 2-615 and 2-619. After hearing oral argument on the motion, the trial court entered an order on February 7, 2003, dismissing the complaint. With regard to the declaratory judgment count, the court ruled that the building is owned by the City, because under the City - FAA land lease, any structure not removed from the City's land within 90 days after termination of that lease "becomes the City's." Regarding the unjust enrichment claim, the court concluded that "[a] party is not unjustly enriched by retaining a benefit which law and equity gives him an absolute right to retain"; that the City had "an absolute right to retain the building"; and that the plaintiffs "had an opportunity to protect [their] interest and negotiated the lease that [they] negotiated."
 Initially, we note the City moved to dismiss the complaint under both sections 2-615 and 2-619(a)(9), using an improper hybrid motion. In addition, the trial court granted the motion without distinguishing between the two procedures, which often causes unneeded complication and confusion. Talbert v. Home Savings of America, F.A., 265 Ill. App. 3d 376, 379 (1994), citing Janes v. First Federal Savings & Loan Ass'n, 57 Ill. 2d 398, 405-06 (1974); MBL (USA) Corp. v. Diekman, 137 Ill. App. 3d 238, 241-42 (1985). Instead, the City should have first challenged the legal sufficiency of the complaint under section 2-615. Only after the trial court determined that a legally sufficient cause of action had been stated should it have entertained a section 2-619 motion. Talbert, 265 Ill. App. 3d at 379. However, in cases where the interests of judicial economy would be served and the plaintiff is not prejudiced thereby, the motion shall be deemed to have been filed in the proper manner. Talbert, 265 Ill. App. 3d at 379, citing Smith v. Chemical Personnel Search, Inc., 215 Ill. App. 3d 1078, 1081-82 (1991). In this case, we will consider the defendant's motion properly filed.
 On appeal, the plaintiffs argue that the trial court erred in dismissing count I of their complaint where it adequately stated all of the required elements of a cause of action for declaratory judgment. The defendant responds that the plaintiffs' complaint fails to allege the required elements of a declaratory judgment action.
 The standard of review from a section 2-615 motion is whether the complaint sufficiently states a cause of action. Accordingly, the merits of the case are irrelevant. Talbert, 265 Ill. App. 3d at 380. Moreover, any exhibits attached to the complaint are to be considered part of and integrated into the complaint. 735 ILCS 5/2-606 (West 2002). In ruling on a section 2-615 motion to dismiss, we must accept as true all well-pleaded facts and reasonable inferences that could be drawn from ...