
652 P.2d 240 (1982)
98 N.M. 690
THREE RIVERS LAND COMPANY, INC., and Marvel Engineering Company, Plaintiffs-Appellees,
v.
Don MADDOUX and Jacquelyn Maddoux, Maddoux Family Trust, David Emmert, as Temporary Successor Trustee, and David Emmert, Individually, Defendants-Appellants.
No. 13925.
Supreme Court of New Mexico.
September 28, 1982.
*241 Walter R. Parr, Las Cruces, for defendants-appellants.
Marian Matthews, Albuquerque, for plaintiffs-appellees.

OPINION
EASLEY, Chief Justice.
Three Rivers Land Company and Marvel Engineering Company sued Don and Jacquelyn Maddoux (Maddoux), Maddoux Family Trust, and David Emmert as trustee and individually for breach of contract and fraud. Maddoux filed a motion to dismiss, which was denied by the trial court. Leave to file an interlocutory appeal was granted, and we reverse.
We discuss:
1. Whether the doctrine of election of remedies is a defense in New Mexico.
2. Whether the elements of legal capacity and same cause of action under the doctrine of res judicata are present.
The case on appeal depends greatly on the understanding of an earlier case. We find it appropriate to discuss the facts surrounding the cases and the procedural posture of both.


*242 CV-58-79 (Case I)

In the earlier case (Case I), Three Rivers and Marvel Engineering sued Don and Jacquelyn Maddoux, Maddoux Trust, and David Emmert, in his capacity as temporary successor trustee, for specific performance of certain purchase and lease contracts and for a preliminary injunction to force the defendants to close the contracts. The trial court granted the preliminary injunction and ordered the conveyance of the real property.
Before or on the closing date of the purchase and lease agreements, Three Rivers and Marvel knew that Crocker National Bank and Security Bank and Trust Company were foreclosing on the property. On that same day, the trial court granted a preliminary injunction against Maddoux and the Family Trust, directing defendants to transfer possession of the property to Three Rivers and Marvel. The court also ordered the clerk of the district court to issue deeds to Three Rivers and Marvel, since the defendants would not.
While in possession, Three Rivers and Marvel commenced farming operations and protected the property from wind and water erosion. They noticed that the dikes and dams on the property were not of sufficient size and strength to protect the property. This defect had not been disclosed. Maddoux and the Family Trust had also represented that a gas well could be purchased for $8,000. To make this well operational, however, Maddoux and the Family Trust had to perform certain acts that they had not intended to perform. Three Rivers and Marvel remained in possession about a year, after which they were ousted by the foreclosure actions of Crocker National Bank and Security National Bank and Trust Company. The property was sold to Trinity Land Company, which was owned by Three Rivers and Marvel.
Before entry of judgment, Three Rivers sought two times to amend the complaint to include a claim for damages. The trial judge denied the motions, stating that he did not want to confuse questions of law and equity.
Because of the foreclosures by the two banks, the material representations regarding the number of irrigable acres, the question regarding the availability of the gas well, and the existence of latent defects on the property, the trial court decided that specific performance was an inappropriate remedy. The trial court then dissolved the preliminary injunction, revoked the deeds, and granted attorney fees and costs. No appeal of this case was taken.

CV-209-80 (Case II)
This is the case properly before us on interlocutory appeal. The case is almost identical to Case I, with the exceptions that in Case II the claim in law is for damages and the status of defendant David Emmert is slightly different.
Emmert, a Colorado resident, filed an answer alleging inter alia that the trial court lacked personal jurisdiction over him and that res judicata, collateral estoppel, and election of remedies bar this action. The trial court denied all Emmert's affirmative defenses and entered judgment in favor of Three Rivers. No appeal was taken.
Maddoux filed a motion to dismiss, asserting that res judicata and collateral estoppel bar this suit. The motion was denied, and an interlocutory appeal was taken.

1. Election of Remedies

Maddoux argues that Three Rivers and Marvel are barred from bringing Case II under the doctrine of election of remedies. Three Rivers and Marvel contend that the doctrine is no longer applicable in New Mexico and rely on Buhler v. Marrujo, 86 N.M. 399, 524 P.2d 1015 (Ct.App. 1974).
We point out that a motion to dismiss is an inappropriate pleading with which to raise the doctrine of election of remedies. A motion to dismiss tests the legal sufficiency of the complaint. Caroll v. Bunt, 50 N.M. 127, 172 P.2d 116 (1946). "A motion to dismiss under Rule 12(b)(6) is properly granted only when it appears that the plaintiff cannot recover or be entitled to relief under any state of facts provable *243 under the claim." Jones v. International Union of Operating Engineers, 72 N.M. 322, 325, 383 P.2d 571, 573 (1963) (citations omitted). A close reading of Maddoux's contentions reveals that he does not challenge the legal sufficiency of the complaint but instead, asserts that this action is barred under the doctrine of election of remedies. The doctrine pertains to the choice or adoption of one of two or more existing remedies; the use of one remedy precludes pursuing the other. Franciscan Hotel Co. v. Albuquerque Hotel Co., 37 N.M. 456, 24 P.2d 718 (1933).
We further note that Maddoux said that he raised election of remedies in his motion to dismiss. Our careful examination of his motion shows that he did not. Moreover, if he raised it at the hearing, he did not provide us with the transcript of that hearing. It is the duty of the appellant to see that the record is properly before us. State ex rel. State Highway Commission v. Sherman, 82 N.M. 316, 481 P.2d 104 (1971). We will not consider matters not contained in the record on appeal. Adams v. Loffland Brothers Drilling Co., 82 N.M. 72, 475 P.2d 466 (Ct.App. 1970). However, when both parties have thoroughly briefed the issue, when there is no objection from the appellee, when the question raised is of such fundamental importance that its ramifications will affect the law, and when remanding the question will serve only to thwart judicial economy, we have the discretion to hear and decide the issue. See DesGeorges v. Grainger, 76 N.M. 52, 412 P.2d 6 (1966). We therefore address the issue.
In Buhler, supra, Judge Sutin held the doctrine of election of remedies to be procedural and therefore not a defense. We disagree. The mere fact that the doctrine is procedural does not preclude its use as a defense. The two concepts are interrelated. Substantive law "`creates, defines and regulates the rights and duties of the parties * * * which may give rise to a cause for action,'" while procedural law prescribes "`the legal machinery by which the substantive law is determined.'" Honaker v. Ralph Pool's Albuquerque Auto Sales, Inc., 74 N.M. 458, 465, 394 P.2d 978, 983 (1964) (quoting Petty v. Clark, 113 Utah 205, 214, 192 P.2d 589, 593-94 (1948)). Relying on Judge Sutin's reasoning, we would have to say that res judicata is not a defense. This is unequivocally not so; res judicata is a defense. N.M.R. Civ.P. 8(c), N.M.S.A. 1978 (Repl.Pamp. 1980). Similarly, election of remedies is a defense in New Mexico. We therefore overrule Buhler.
Election of remedies is a rule of judicial administration. Honaker v. Ralph Pool's Albuquerque Auto Sales, Inc., supra. Its underlying purpose is to prevent "`vexatious and multiple litigation of causes of action arising out of the same subject matter.'" Honaker, supra, at 466, 394 P.2d at 984 (quoting Dial Press, Inc. v. Phillips, 23 N.J. Super. 543, 548, 93 A.2d 195, 197 (1952)). However, the doctrine has been abused by lawyers and courts, Hine, Election of Remedies, A Criticism, 26 Harv.L.Rev. 707 (1913), and it has been obscured and misunderstood. Note, Election of Remedies: A Delusion?, 38 Colum.L.Rev. 292 (1938). Moreover, "[i]t has been constantly criticized as harsh and not a favorite of equity." Bernstein v. United States, 256 F.2d 697, 705 (10th Cir.1958) (citation omitted). As an equitable doctrine, it is controlled by principles of equity, including the principle that courts will invoke equity to the end that justice may be served. Pugh v. Phelps, 37 N.M. 126, 19 P.2d 315 (1932).
The doctrine of election rests upon the principle that he who seeks equity must do it, and means, as the term is ordinarily used, that where two inconsistent or alternative rights or claims are presented to the choice of a party, by a person who manifests the clear intention that he should not enjoy both, then he must accept or reject one or the other; and so, in other words, that one cannot take a benefit under an instrument and then repudiate it.
Peters v. Bain, 133 U.S. 670, 695, 10 S.Ct. 354, 362, 33 L.Ed. 696 (1890).
Since the doctrine is one of equity, we will review the trial court's decision *244 based on the abuse of discretion standard. An abuse of discretion will be found when the trial court's decision is contrary to logic and reason. Federal Land Bank of Wichita v. Burgett, 97 N.M. 519, 641 P.2d 1066 (1982). The trial court twice denied Three Rivers' motion to amend the complaint for damages in Case I on the belief that mixing questions of law and equity would unnecessarily confuse matters. This fact, coupled with the undisputed and admitted bad acts by Maddoux, suggests that Maddoux should not be allowed to benefit from the doctrine. Therefore, we find no abuse of discretion. The trial court is affirmed.

2. Res Judicata

Maddoux contends that Three Rivers split their cause of action, and thus, under the principles of res judicata, they are barred from bringing Case II. Three Rivers argues that res judicata does not apply. First, the relief sought in Case I was equitable, while in Case II the action is for damages. Three Rivers therefore argues that these are two distinct causes of action. Second, the status of Emmert in Case I was "successor trustee," which is different from "trustee and individually" in Case II. Three Rivers asserts that because Emmert appeared in different legal capacities, res judicata does not apply. Finally, Three Rivers claims that invoking res judicata would not be in the best interests of justice. Three Rivers argues that to appeal the trial court's denial of leave to amend the complaint in Case I is costly and difficult and that the standard of appellate review in that type of case is abuse of discretion.
As a preliminary matter, we address whether res judicata may be raised in a motion to dismiss. We said earlier in this opinion that a motion to dismiss tests the legal sufficiency of the complaint. Maddoux does not maintain that the facts pled in the complaint fail to state a cause of action. Rather, he asserts that given these facts, the affirmative defense of res judicata bars Case II. We should therefore dismiss the appeal as improperly before us.
However, we recognize that this is an interlocutory appeal for which Maddoux has not yet filed an answer. The effect of dismissing the appeal would allow Maddoux to file an answer containing the affirmative defense of res judicata. The question would again surface on our docket. In the interest of the speedy administration of justice, therefore, we address the question.
The underlying principle behind res judicata is to "relieve parties of the cost and vexation of multiple lawsuits, conserve judicial resources, and by preventing inconsistent decisions, encourage reliance on adjudication." Allen v. McCurry, 449 U.S. 90, 94, 101 S.Ct. 411, 414, 66 L.Ed.2d 308 (1980) (citation omitted); cf. Adams v. United Steelworkers, 97 N.M. 369, 640 P.2d 475 (1982) (collateral estoppel is a judicial economy measure). Res judicata applies when four elements are met: (1) identity of parties or privies, (2) identity of capacity or character of persons for or against whom the claim is made, (3) same cause of action, and (4) same subject matter. Adams v. United Steelworkers, supra.
There is no doubt that the parties and subject matter are the same in both cases. The points of contention involve legal capacity and cause of action.

A. LEGAL CAPACITY.
The requirement that a party be in the same or similar legal capacity in a suit relates to the fundamental precept that "a person cannot be bound by a judgment unless he has had reasonable notice of the claim against him and an opportunity to be heard in opposition to that claim." Drickersen v. Drickersen, 546 P.2d 162, 170 (Alaska 1976) (footnote omitted); accord Blonder-Tongue v. University Foundation, 402 U.S. 313, 91 S.Ct. 1434, 28 L.Ed.2d 788 (1971); Restatement (Second) of Judgments § 34 reporter's note (1980); see also id. § 36; F. James & G. Hazard, Civil Procedure § 11.6 (2d ed. 1977); Annot., 170 A.L.R. 1180 (1947).
Although Emmert was sued in different legal capacities in both cases, we do not see how this affects the lawsuit between Three Rivers and Maddoux. Three Rivers' and Maddoux's legal capacities did not change in Case I and Case II. Moreover, *245 Three Rivers cannot point to any prejudice suffered or show that the change in Emmert's legal capacity has any bearing on the suit against Maddoux. We therefore find Three Rivers' argument unpersuasive. The legal capacity element of res judicata is met.

B. SPLITTING CAUSE OF ACTION.
In the nineteenth century, a very narrow definition of "cause of action" was used. The definition varied in terms of "same remedial right," identical "substantive" or "primary" right or suits having the "same evidence." See J. Pomeroy, Code Remedies §§ 346-56 (5th ed. 1929); Schopflocher, What is a Single Cause of Action for the Purpose of the Doctrine of Res Judicata?, 21 Or.L.Rev. 319 (1942); Vestal, Res Judicata/Claim Preclusion: Judgment for the Claimant, 62 Nw.U.L.Rev. 357 (1967). The problem with these tests is that they are perfunctory and fail to account for particular situations. "Whether causes of action are identical for res judicata purposes * * * cannot be determined precisely by mechanistic application of a simple test." Abramson v. University of Hawaii, 594 F.2d 202, 206 (9th Cir.1979) (citation omitted).
Our Court has never decided what constitutes a cause of action for res judicata purposes. Reliance on the nineteenth century interpretations offers little guidance and probably adds to the already existing confusion. We, accordingly, reject those views. Our courts need guidelines, and we adopt the rules contained in Restatement, supra §§ 24 and 25. We reproduce them for the convenience of the Bar.
§ 24. Dimensions of "Claim" for Purposes of Merger or Bar  General Rule Concerning "Splitting"
(1) When a valid and final judgment rendered in an action extinguishes the plaintiff's claim pursuant to the rules of merger or bar * * *, the claim extinguished includes all rights of the plaintiff to remedies against the defendant with respect to all or any part of the transaction, or series of connected transactions, out of which the action arose.
(2) What factual grouping constitutes a "transaction", and what groupings constitute a "series", are to be determined pragmatically, giving weight to such considerations as whether the facts are related in time, space, origin, or motivation, whether they form a convenient trial unit, and whether their treatment as a unit conforms to the parties' expectations or business understanding or usage.
§ 25. Exemplifications of General Rule Concerning Splitting
The rule of § 24 applies to extinguish a claim by the plaintiff against the defendant even though the plaintiff is prepared in the second action.
(1) To present evidence or grounds or theories of the case not presented in the first action, or
(2) To seek remedies or forms of relief not demanded in the first action.
We recognize that "[g]eneral adoption of the [Restatement] approach will neither change resolution of the easy problems nor ease resolution of the difficult problems. It will remain as clear as ever that a mere change in a legal theory does not create a new cause of action. Many common problems will continue to be answered by well-established rules, as they should be. But in approaching difficult or novel questions, it will be found that the [Restatement approach] defines a process rather than an absolute concept." 18 C. Wright, A. Miller & E. Cooper, Federal Practice and Procedure § 4407 (1981) (footnote omitted). The essence of the Restatement approach "is to see claim in factual terms and to make it coterminous with the transaction regardless of the number of substantive theories, or variant forms of relief flowing from those theories, that may be available to the plaintiff." Restatement, supra § 24 comment a. Thus, "where one act causes a number of harms to, or invades a number of different interests of the same person, there is still but one transaction." Id. § 24 comment c. Different legal theories arising out of a "given episode do not create multiple transactions and hence multiple claims." Id.
While it was true that a successful suit in equity would not preclude an action at law, this is not so today. "[A] judgment granting or denying specific performance of *246 a contract should preclude an action for money damages." Id. § 25 comment (i)(2). Both cases arise out of the same transaction, a land contract. The only difference is the remedy sought. We therefore find that the cause of action requirement of res judicata is met.
We further recognize that there are exceptions to the doctrine of res judicata. Id. § 26. Three Rivers states that imposing res judicata would be unjust because the trial court would not allow them to amend their complaint to include a claim for damages based on the trial court's belief that mixing questions of law and equity would be confusing. The Restatement does contain an exception similar to the one Three Rivers requests: "The court in the first action has expressly reserved the plaintiff's right to maintain the second action." Id. § 26(1)(b). The comment to this provision makes it clear that the trial court's refusal to grant leave to amend the complaint "is not a reservation by the court. * * * The plaintiff's * * * recourse against an incorrect refusal of an amendment is direct attack by means of appeal from an adverse judgment." Id. § 26 comment b. We find that this exception does not apply.
The trial court should have found that res judicata barred Case II, and we therefore reverse.
IT IS SO ORDERED.
SOSA, Senior Justice, and PAYNE, J., concur.
