
28 A.3d 223 (2011)
Darwin R. TOBIAS, Sr. and Shirley I. Tobias, Appellants
v.
HALIFAX TOWNSHIP.
No. 1912 C.D. 2010.
Commonwealth Court of Pennsylvania.
Argued June 6, 2011.
Decided August 26, 2011.
*224 John J. Krafsig, Jr., Harrisburg, for appellants.
Anthony R. Sherr, Blue Bell, for appellee.
BEFORE: LEADBETTER, President Judge, and LEAVITT, Judge, and BROBSON, Judge (P).
OPINION BY Judge LEAVITT.
Darwin and Shirley Tobias appeal an order of the Dauphin County Court of Common Pleas granting Halifax Township's motion for judgment on the pleadings in a civil action arising out of a long-standing dispute between the Tobiases and the Township over the realignment and reconstruction of Keefer Road, which abuts and bisects the Tobiases' property. The trial court held that the Tobiases' claim for "reversion costs"[1] to restore their property to its condition prior to construction was barred by the doctrine of res judicata. We affirm.
In 1997, the Township decided to realign the course of Keefer Road to remove a dangerous curve in the road. Because the Township proposed to have the reconfigured roadway cross the Tobiases' property, the parties entered into a contract. The Township agreed, inter alia, to construct the road in accordance with specifications in the contract, and the Tobiases agreed to execute a deed of dedication to the Township upon completion of the project.
The Township completed the reconstruction of Keefer Road in 1999, at which point the Tobiases instituted a breach of contract *225 action against the Township, alleging that the road did not conform to the contractual specifications. Their complaint alleged that at certain points the road was two and one-half feet higher than the plan called for; at other points the center line of the road was off by seven or eight feet. In addition, the Township failed to configure the road in such a way that the Tobiases would be left with a one-acre lot, on which a home could be built under applicable zoning regulations. Finally, the Township failed to leave behind excess top soil, as it agreed to do in the contract. The Tobiases sought damages for breach of contract in the amount of $313,486.42. The case proceeded to a jury trial. The jury found that the Township had breached the contract and awarded the Tobiases $16,000 in damages.[2]
Thereafter, on November 20, 2007, the Tobiases instituted a second action against the Township, again challenging the construction of Keefer Road. This time the Tobiases wanted the portion of the realigned road that crossed over their land removed. Their basis for seeking this relief was the fact that the Township did not construct the Road in conformance with the contract, and as such, a deed of dedication was never given. The complaint sought the Township's removal of 36,910 square feet of roadway, which is illustrated in "Plaintiffs' Exhibit B." Reproduced Record at 14a. This area represents the entire portion of Keefer Road which was realigned to remove the dangerous curve. Thus, the Tobiases seek to have the Township realign Keefer Road, this time to its pre-1999 configuration, and to return their land to its pre-1999 condition. Count I of the complaint seeks damages in the amount of $211,849.05, which represents the cost of removing the trespassing portions of the road; installing storm sewers; reconstructing the roadway; and restoring the land to its 1999 condition. Count II seeks the abatement of storm water runoff occurring at a different portion of the Road.
The Township filed a motion for judgment on the pleadings, asserting, inter alia, that Count I was barred by res judicata. The trial court granted the Township's motion, holding that the Tobiases could have raised their so-called "reversion" claim in the 1999 action.[3] The present appeal followed.
On appeal,[4] the Tobiases contend that the trial court erred and abused its discretion in holding that Count I was barred by res judicata.[5] The Tobiases *226 argue that Count I presents an entirely new cause of action even though it arises from the same facts presented in the 1999 action. Specifically, they argue that the 1999 breach of contract sought to have the road constructed in accordance with the terms of the agreement; the present action is for "reversion," or removal, of that portion of the road that trespasses upon their land. The Tobiases also argue that the two actions are different because in 1999 they sought damages equal to the cost of having the road constructed in accordance with their contract with the Township. In the current action, they seek to have a trespass remedied by having the offending portion of the road removed from their property.
The Township counters that the Tobiases are simply attempting to relitigate matters that have already been litigated to conclusion.[6] The Township notes that in the 1999 action the Tobiases sought damages for the Township's failure to construct the road in accordance with the contractual specifications. In the present action, the Tobiases seek damages for removal of that portion of the road that now trespasses upon their land because the Township breached the contract.[7]
Under the doctrine of res judicata, or claim preclusion, an action is barred because it is grounded, either in whole or in part, upon a claim which was the subject of a prior adjudication by a court of competent jurisdiction. R/S Financial Corp. v. Kovalchick, 552 Pa. 584, 588, 716 A.2d 1228, 1230 (1998). Therefore, if a court renders a final judgment on the merits, res judicata will preclude any future suit between the parties on the same cause of action, or concerning any claims which could have been litigated during the first proceeding. Id. See also Callowhill Center Associates, LLC v. Zoning Board of Adjustment, City of Philadelphia, 2 A.3d 802, 809 (Pa.Cmwlth.2010).
In order for the doctrine of res judicata to apply four conditions must concur: (1) identity of the thing sued upon or for; (2) identity of the cause of action; (3) identity of the persons and parties to the action; and (4) identity of the quality or capacity of the parties. Stevenson v. Silverman, 417 Pa. 187, 190, 208 A.2d 786, 787-788 (1965); Swift v. Radnor Township, 983 A.2d 227, 232 (Pa.Cmwlth.2009). Generally, a cause of action will be considered identical when the subject matter and the ultimate issues are the same in both proceedings. Swift, 983 A.2d at 232. Finally, it is well-settled that res judicata will not be "defeated by minor differences of form, parties, or allegations, when these are contrived only to obscure the real purpose,a second trial on the same cause between the same parties." Stevenson, 417 Pa. at 192, 208 A.2d at 788 (quoting Hochman v. Mortgage Finance Corporation of Pennsylvania, 289 Pa. 260, 263, 137 A. 252, 253 (1927)).
*227 In the case sub judice, the parties are the same as those in the 1999 action. The parties are suing, and being sued, in the same capacity as they were in 1999. Moreover, the thing being sued upon, i.e., the subject matter of both suits, is the same: the Township's failure to construct Keefer Road in accordance with the terms of the parties' written agreement. The only question is whether each action presented the same cause of action.
When determining whether two causes of action are the same for purposes of res judicata we look to, inter alia, the similarity of the acts complained of, the demand for recovery, and the facts alleged. Swift, 983 A.2d at 232. In doing so, we keep in mind that a party cannot avoid res judicata simply by varying the legal theory for relief or by recasting the nomenclature for the relief requested. Id.
Here, the two causes of action are identical. The 1999 and the 2007 complaints allege virtually identical facts. Each action claimed that the Township failed to construct Keefer Road in accordance with the agreement, and each action sought monetary damages for this alleged breach of contract. In both cases, the Tobiases explain they did not execute a deed of dedication to the Township because of the Township's breach of contract.
Styling their 2007 complaint as one for "reversion," as opposed to one for breach of contract, does not defeat res judicata. The Tobiases seek $211,849.05 in damages, so that they may have their property returned to its original condition. In 1999, they sought to have Keefer Road constructed in accordance with the agreed-upon contract terms or the payment of $313,486.42 in damages. In the 1999 action, trial court found that Keefer Road had been adequately constructed and that its course did not need to be realigned.[8] The Tobiases claim that their cause of action for "reversion" damages could not be brought until completion of the first trial, which they lost. Because they lost, now the road is trespassing on their land.[9]
Res judicata bars all causes of action that were either raised or could have been raised during a prior proceeding. R/S Financial Corp., 552 Pa. at 588, 716 A.2d at 1230 (emphasis added). The Tobiases could have raised their request to have the road removed and their land returned to its pre-1999 condition in their 1999 complaint as relief alternative to the reconstruction they did request in 1999. The alleged encroachment has existed since the completion of the realignment of Keefer Road, which was done prior to the 1999 action. The Tobiases could have asserted that the road, as constructed, trespasses on their land and sought removal of the trespass. They did not do so, and it is too late now.
We hold that the trial court did not err dismissing Count I of the Tobiases' complaint by reason of res judicata. Accordingly, we affirm.

ORDER
AND NOW, this 26th day of August, 2011, the order of the Court of Common Pleas of Dauphin County, dated June 23, 2009, in the above-captioned matter is hereby AFFIRMED.
NOTES
[1]  The Tobiases have used the term "reversion" in an unusual way. A "reversion" is a future interest in land that arises by operation of law when a grantor of an estate fails to dispose of his entire interest. BLACK'S LAW DICTIONARY at 1320 (7th. ed., 1999). According to their complaint, the Tobiases are requesting "judgment against the [Township], for the necessary reversion costs to restore the [Tobiases'] property to its condition and realignment of the said Keefer Road prior to August 25, 1997...." Reproduced Record at 6a.
[2]  The record does not explain what action constituted a breach or what loss was compensated by the $16,000 award.
[3]  The trial court did not dismiss Count II of the complaint. Count II went to a jury trial, and a verdict was entered in favor of the Township on August 24, 2010.
[4]  Our scope of review of an order granting a motion for judgment on the pleadings is limited to determining whether the trial court committed an error of law or whether questions of material fact remain outstanding, such that the case should have gone to the jury. Our standard of review of an order granting or denying a motion for judgment on the pleadings is plenary. Trib Total Media, Inc. v. Highlands School District, 3 A.3d 695, 698 n. 3 (Pa.Cmwlth.2010) (citations omitted).
[5]  In arguing the trial court abused its discretion, the Tobiases assert that the trial court, sua sponte, raised issues that were not properly before it. Specifically, the Tobiases take issue with a portion of the trial court's Rule 1925(a) opinion in which it notes that it did not understand why a deed of dedication was not issued or why the Township had not executed a taking of the Tobiases' land. See Trial Court Opinion, January 13, 2011, at 3. This argument is of no moment. As noted in the opinion itself, the court was simply "wonder[ing] out loud." Because these statements were merely dicta and did not form the basis of the trial court's decision, they are irrelevant to the merits of the trial court's grant of judgment on the pleadings with respect to Count I.
[6]  The Township also argues that the Tobiases' claim is barred by the statute of limitations, which is four years for breach of contract actions and two years for trespass actions. See 42 Pa.C.S. §§ 5525, 5524. The Township raised this issue below, but the trial court did not address it.
[7]  The Township also contends that the Tobiases' claim is barred by collateral estoppel. However, since the doctrine of res judicata subsumes the doctrine of collateral estoppel we need not separately address this issue. See Callowhill Center Associates, LLC v. Zoning Board of Adjustment, City of Philadelphia, 2 A.3d 802, 809 (Pa.Cmwlth.2010).
[8]  This finding of the trial court is not apparent from the record. Both parties agree in their briefs that the 1999 action determined that Keefer Road did not have to be realigned.
[9]  If the Tobiases are correct about the trespass then they may have a cause of action for a de facto taking under the Eminent Domain Code, 26 Pa.C.S. §§ 101-1106.
