Lenk, J.
Reduced to essentials, the issue before us is whether a Probate Court judge erred in determining that the appellee Richard Cox is entitled to repayment from Edward Mahlowitz, his former wife’s lawyer, of counsel fees that Cox had paid to Mr. Mahlowitz pursuant to a judgment that was subsequently reversed on appeal.
[865]*865I. Factual and procedural background. We distill and summarize such of the somewhat convoluted facts of record as are relevant to the issue on appeal. The plaintiff is Nancy Cox (wife),2 the former wife of the defendant-appellee Richard Cox (husband). The wife retained Attorney Edward Mahlowitz — the true appellant here3 — to represent her following the entry of a divorce judgment that was predicated upon a settlement agreement as to which she apparently later had second thoughts. Mr. Mahlowitz thereafter successfully moved on the wife’s behalf to vacate the judgment as to the division of marital property, and following trial, a new judgment that was more favorable to the wife in that regard entered. In connection with these and related matters,4 as well as certain contempt proceedings against the husband, Mr. Mahlowitz requested, again on the wife’s behalf, the award of his counsel fees and costs. The judge ordered, as part of the amended judgment on further division of the marital assets, that the husband pay to Mr. Mahlowitz, as attorney for the wife, presumably pursuant to G. L. c. 208, § 38, and G. L. c. 215, § 34A,5 approximately $30,000 in counsel fees, a sum that was less than half of the fee [866]*866requested.6 Thereafter, Mr. Mahlowitz again sought fees and costs specifically in connection with his prosecution of a second complaint for contempt and was awarded $1,075.00, presumably pursuant to G. L. c. 215, § 34A, as requested, and again less than half of the amount sought. The husband ultimately paid Mr. Mahlowitz the fees awarded.
The husband appealed both from the order vacating the judgment of divorce and from the subsequent judgment further dividing the marital assets. The wife retained new counsel to handle the appeal, who apparently elected not to appeal on her behalf from any portion of the judgments adverse to the wife. A panel of this court, in an unpublished memorandum and order issued pursuant to rule 1:28, Cox v. Cox, 44 Mass. App. Ct. 1118 (1998) (our memorandum and order), determined that it was error for the Probate Court judge to have allowed the wife’s motion to vacate the judgment, stating:
“It follows that the section 34 hearing, the amended judgment . . . that resulted from the hearing, and all orders arising out of the allowance of the motion to vacate and the entry of amended judgment were nullities.
“The allowance of the plaintiff’s motion to vacate the divorce judgment is vacated, and the original judgment of [867]*867divorce is reinstated. The case is remanded to the Probate Court for the purpose of acting upon any application of the defendant to restore the parties to the status quo ante, consistent with this opinion.”
In short order thereafter, the husband moved to “restore the parties to status quo ante,” the Probate Court judge whose orders had been reversed on appeal abruptly recused himself sua sponte and without explanation, and the wife filed for bankruptcy. Despite the suggestion of bankruptcy and motion to continue filed on the wife’s behalf, a different Probate Court judge (the motion judge) acted on the husband’s motion and ordered the wife to take certain actions to restore the husband to his former position. As the husband requested, in addition to nullifying certain qualified domestic relations orders concerning pension benefits, the motion judge ordered the wife to pay the husband the $127,120 previously awarded her, plus interest, and to pay the husband $47,301.43 in counsel fees incurred in connection with the trial and appeal. As particularly relevant here, the order of the motion judge also stated that:
“Nancy L. Cox, and her attorney, Edward Mahlowitz, are hereby ordered to pay to the defendant, Richard E. Cox, the amount of . . . $31,075 together with interest at the rate of . . . 12% per annum from May 31, 1996 to date of payment, within ... 30 days of this Court’s order.”
This order as to Mr. Mahlowitz entered despite the fact that he had not been served with the husband’s “Motion to Restore Parties to Status Quo Ante Pursuant to Appeals Court Decision” and did not participate in the hearing, just as he had not participated in the appeal. In the motion judge’s written rationale for the order, he notes — presumably on the basis of inferences he drew from our memorandum and order — that the equities favored the husband since the wife and Mr. Mahlowitz had been “less than candid with the Court” in bringing the motion pursuant to Mass.R.Civ.P. 60(b), 365 Mass. 828 (1974), which was “without substance,” “a meritless proceeding,” and prosecuted in “bad faith.”
[868]*868Mr. Mahlowitz, upon being notified of the judge’s order, successfully moved to stay and vacate the order insofar as it concerned him. Sua sponte, however, the judge joined Mr. Mahlowitz as a party plaintiff and, following an April 1, 1999, limited evidentiary hearing,7 ordered him to repay the $31,075. The judge observed that:
“[I]t was he who initiated the [rjule 60(b) proceeding . . . which the Appeals Court found to be without merit. Further, Attorney Mahlowitz was notified by counsel for the husband of the appeal. He knew or should have known that if the appeal were successful, all orders made by the judge including those for attorney’s fees, were in jeopardy.
“Inasmuch as the judgment ... is a nullity, it follows that the order to pay legal fees to Attorney Mahlowitz pursuant to that nullified judgment is, in and of itself, a nullity. Only by repayment of the $31,075 can the husband (a party) be restored to the status quo ante [szc] contemplated by the Appeals Court decision. . . .
“Inasmuch as Attorney Mahlowitz did not receive any interest on any amounts paid to him and there has been no finding of unethical or improper conduct on Attorney Mahlowitz’s part (other than the statement in the Appeals Court decision that the allegations in the [rjule 60(b) motion were “at the very least, inexplicable”) in my discretion, I believe it would be inequitable to award interest retroactively.”
Mr. Mahlowitz complied with the order and paid the husband, then timely filed this appeal in which the wife did not participate.
II. Discussion. On appeal, Mr. Mahlowitz challenges on numerous grounds the order requiring him to repay counsel fees. Fie contends, variously, that the Probate Court was without [869]*869subject matter jurisdiction to make such an order, that the motion judge erred in joining him as a party plaintiff, that the husband did not raise or preserve the counsel fee issue on appeal or give Mr. Mahlowitz timely notice that he was asserting such a claim against him, that the motion judge misinterpreted the scope and effect of this court’s memorandum and order, and that his constitutional rights were violated.
In addressing, this plethora of claims, we are struck by the fact that neither the husband nor Mr. Mahlowitz denominated the remedy that the husband sought by its proper name — restitution — and that they did not bring either to our attention or to the attention of the motion judge any pertinent cases or authorities on the subject. The resulting misdirection may account for the somewhat scattershot nature of many of the issues raised on appeal, the bulk of which can be disposed of with dispatch. This same misdirection, however, also necessitates a remand to permit consideration anew of the question whether the husband is entitled to a remedy in restitution against Mr. Mahlowitz, this time on the basis of relevant factors that we later outline.
Subject matter jurisdiction. There is no merit in Mr. Mahlowitz’s contention that the Probate Court was without jurisdiction to order him to make repayment. While the Probate Court is a court of limited jurisdiction, it has general equity powers. See G. L. c. 215, § 6; Young v. Department of Pub. Welfare, 416 Mass. 629 (1993). “Our Probate Court . . . [possesses] inherent powers apart from statutory authorization. These powers are broad and flexible, and extend to actions necessary to afford any relief in the best interests of a person under their jurisdiction.” Matter of Moe, 385 Mass. 555, 561 (1982). The court accordingly has the power to correct what has been wrongfully done, such as ordering a restitution of monies obtained under the court’s statutory authority after the decision has been overturned. See, e.g., Keller v. O’Brien, 425 Mass. 774 (1997) (Keller II); Heron v. Heron, 428 Mass. 537 (1998). See also United States v. Morgan, 307 U.S. 183, 197 (1939) (courts have inherent authority to order restitution).
Joinder. The motion judge sua sponte joined Mr. Mahlowitz as a party plaintiff, citing Edinburg v. Edinburg, 22 Mass. App. [870]*870Ct. 192 (1986), and Mass.R.Dom.Rel.P. 19(a). The sua sponte aspect of the joinder is beyond dispute under the rule. However, insofar as the husband maintained in his motion papers that the wife was jointly and severally liable for the counsel fee awarded, Mr. Mahlowitz was not technically a necessary party for joinder purposes. See Mongeau v. Boutelle, 10 Mass. App. Ct. 246, 253 (1980). Nonetheless, we think the point without consequence here since the husband had an independent cause of action in restitution against Mr. Mahlowitz which he could have asserted in the same court.
Preservation/notice of counsel fee claim. Despite Mr. Mahlo-witz’s contention that the husband failed to challenge the fee award on appeal, the record is clear that the husband appealed from both the order vacating the judgment of divorce and the subsequent amended judgment on further division of the marital assets. The appeal from the order vacating the judgment of divorce itself placed the orders subsequent to it in jeopardy. Further, because the counsel award was one of four orders listed on the amended judgment, its propriety was without question among the matters challenged on appeal.8
That, of course, is not to say that Mr. Mahlowitz was fairly on notice that the issue had been raised or that, were the fee award tipped on appeal, his retention of it would be put at risk. When the husband was ordered to pay Mr. Mahlowitz $30,000 for counsel fees owed by the wife to Mr. Mahlowitz, it was in this sense the wife’s debt that the husband paid. That the wife might be required to repay that amount to the husband as a consequence of reversal on appeal does not of itself necessarily suggest that Mr. Mahlowitz was equally at risk. Mr. Mahlowitz was not a named party to that appeal, does not appear to have been served with the appellate briefs, and represented neither the wife nor himself in connection with the appeal. In our memorandum and order, the panel did not address Mr. Mahlow-itz’s status or liability and, when the husband brought his motion seeking to restore the parties to status quo ante, he did not serve it upon Mr. Mahlowitz. Presumably because of this, the motion judge vacated his initial order requiring Mr. Mahlowitz [871]*871to repay the counsel fees and thereafter conducted a limited evi-dentiary hearing in which Mr. Mahlowitz participated, thereby rectifying, albeit belatedly, the deficiency in notice as to the restitution proceedings.
The memorandum and order pursuant to rule 1:28: its scope and effect. That the motion judge joined Mr. Mahlowitz as a party in connection with the husband’s motion does not mean that Mr. Mahlowitz was thereby transformed into a party ab initia. When the panel of this court remanded the matter for consideration of any application the husband might make to “restore the parties” to the status quo ante, the panel was referring to the parties to the action then before the court, viz., the husband and the wife. Moreover, our memorandum and order to “restore the parties” was not issued in a legal vacuum but rather within the context of well-established equitable remedies. Otherwise put, our memorandum and order contemplated the application of the remedy of restitution, not the mechanical imposition of a foreordained result. The wife has not challenged the orders entered against her, and we proceed on the assumption that the husband was entitled to the equitable relief that he sought from her.9
We have reviewed with care the transcript of the motion hearing in which Mr. Mahlowitz participated, as well as the motion judge’s findings, memorandum and resulting order that required Mr. Mahlowitz to repay the fee. We are persuaded that the motion judge mistakenly construed our memorandum and order as an edict requiring him to do whatever was necessary to put the husband in the position he had been in before the [872]*872original judgment of divorce was vacated at the wife’s behest. This view of the matter had the result of hobbling Mr. Mahlo-witz in his efforts to raise defenses recognized as legitimate in restitution cases. Given this, we conclude that the order at issue cannot stand and that a new hearing, governed by the law of restitution, is necessary to determine whether Mr. Mahlowitz should repay the counsel fees he had been awarded.10
m. Restitution. We are unaware of any Massachusetts appellate authority addressing precisely the issue here, i.e., whether a party’s former attorney, who was himself neither a named party nor a participant in an appeal, may be ordered to restore a fee awarded him as part of a judgment that has been reversed. Before turning to the Restatement of Restitution (1937) and cases from other states that more nearly address this situation, we look to two recent Massachusetts cases that offer some guidance. See Keller II, 425 Mass. 774; Heron v. Heron, 428 Mass. 537.
Massachusetts decisions. In Keller II, the Supreme Judicial Court faced the question of whether and to what extent a former spouse can be ordered to reimburse an ex-spouse for alimony paid under an erroneous judgment. After the husband prevailed11 in his effort to terminate his alimony obligations following his ex-wife’s remarriage, he sought a refund of the monies that he had paid to her after the filing of his initial complaint. The Probate Court judge declined to order the repayment. On appeal, the Supreme Judicial Court affirmed, after first discussing the applicable doctrine of restitution.
“Restitution is an equitable remedy by which a person who has been unjustly enriched at the expense of another [873]*873is required to repay the injured party. Salamon v. Terra, 394 Mass. 857, 859 (1985), quoting Restatement of Restitution § 1 (1937). Jones v. Swift, 300 Mass. 177, 185 (1938). The fact that a person has benefitted from another ‘is not of itself sufficient to require the other to make restitution therefor.’ Restatement of Restitution, supra at § 1 comment c. Restitution is appropriate ‘only if the circumstances of its receipt or retention are such that, as between the two persons, it is unjust for [her] to retain it.’ Id. See National Shawmut Bank v. Fidelity Mut. Life Ins. Co., 318 Mass. 142, 146 (1945).”
(footnote omitted). Keller II, supra at 778. The issue before the court, then, was whether, as between the two former spouses, it was unjust for the wife to retain the payments she received after remarriage. Ibid. Decisional law was of little aid in this regard since no Massachusetts case was on point,12 and no other jurisdiction had ordered a refund in similar circumstances.
Turning to the equities of the situation, the court determined that restitution would be unfair because the wife had no reason to anticipate, as matter of fact or law, that she would be asked to reimburse her husband for alimony received after her remarriage, and a retroactive application of the new rule would be substantially inequitable to the wife. The court declined to order restitution solely on the grounds that the trial court’s denial of the modification complaint was eventually reversed.
“While we have not done so, some courts have ordered restitution where a judgment has been reversed after a party has been ordered by a court to make payment to another, and the judgment has been paid. See Restatement of Restitution § 74 (1937) (‘[a] person who has conferred a benefit upon another in compliance with a judgment. . . is entitled to restitution if the judgment is reversed or set aside, unless restitution would be inequitable . . .’).”
(Emphasis supplied.) Keller II, supra at 781.
Prospectively, however, the court stated:
[874]*874“If a complaint for modification is brought and a probate judge refuses to terminate the alimony obligation, the decision may be appealed. Absent a request for, and the allowance of, a stay of that judgment, the payor spouse must continue to pay alimony pending the appellate court’s decision. But if it is later determined that the probate judge erred, the payments will not operate as a waiver of any timely claim for a refund of the alimony, and restitution may be ordered dating from the judgment of the Probate Court. Our rule is now clear, and we do not anticipate that any hardship will be imposed by restitution in those circumstances. Where hardship is claimed, perhaps by reason of some intervening, unanticipated event during the appellate process, probate judges are in the best position to resolve those claims.”
Keller II, supra at 785.
In Heron v. Heron, 428 Mass. at 542, the court touched upon restitutionary principles after it vacated a judgment of the Probate Court that had modified an out-of-State alimony award and division of marital assets, holding that full faith and credit required Massachusetts to honor the res judicata effect of the out-of-State divorce decree, i.e., the plaintiff’s claim was barred here because it would have been barred if brought there. The court remanded the case to the Probate Court for entry of an order staying the payment of alimony to the plaintiff and for a determination, after hearing, “whether equity requires that the plaintiff make restitution of all or part of the alimony paid to her.” Id. In doing so, the Supreme Judicial Court stated that the Probate Court should take into account “whether restitution would so impoverish [the wife] as to make her a ward of the public.” Id. at 542 n.4. The court also vacated the award of counsel fees, but without discussion of restitution, and the opinion is silent both as to whom the fee award was to be paid (the wife or her lawyer) and as to whether the award had been stayed pending appeal.
The Restatement of Restitution. As noted above, Keller II cited with approval the Restatement of Restitution § 1 (1937) (Restatement), emphasizing that unjust enrichment is the key predicate to recovery when a judgment has been reversed on [875]*875appeal. The view of the Restatement, set out in § 74, follows directly from this, i.e., § 74 does not require restitution automatically upon reversal. This is largely consonant with the position later taken in the Restatement (Third) of Restitution and Unjust Enrichment § 18 (Tentative Draft No. 1, 2001) (Restatement [Third]), “Judgment Subsequently Reversed or Avoided: A transfer or taking of property, in compliance with or otherwise in consequence of a judgment that is subsequently reversed or avoided, gives the disadvantaged party a claim in restitution to the extent necessary to avoid unjust enrichment.”13
What this suggests, then, is that a party seeking restitution from another party after a judgment has been reversed on appeal may satisfy its initial burden of establishing unjust enrichment by showing that the order compelling payment was ultimately reversed. The burden shifts to the payee party to show why it should not be compelled to repay, whether by virtue of change of position, undue hardship or other limited affirmative defenses,14 thereby demonstrating that it would not be unjust for the payee party to retain the amount paid.
Neither Keller II nor Heron v. Heron contemplates any but [876]*876the “relatively straightforward”15 situation where restitution is demanded by one party from another party. Neither addresses the situation where, as here, restitution is demanded by one party from the other party’s lawyer, i.e., a third party. In determining whether a third party in retention of an award that has been overturned has been unjustly enriched, we look to the Restatement and to decisions in other jurisdictions that have considered the question.
The Restatement and other jurisdictions as to third parties. Both the Restatement § 74, and the Restatement (Third) § 18, view third parties in quite a different light than they do parties to the judgment that was reversed. Whereas the initially prevailing party generally (albeit not automatically) will be liable in restitution to repay the other party upon reversal of the judgment pursuant to which payment was made, a nonparty creditor of the initially prevailing party who in good faith received a portion of the judgment proceeds generally will not be required to repay. See Restatement § 74 comments h, k; Restatement (Third) § 18. A nonparty may be liable, however, where the nonparty is effectively a party to the action, such as where an attorney retains portions of the judgment under a contingent fee arrangement.
Comment h to Restatement § 74, entitled “Restitution from attorney or agent of judgment creditor,” states in relevant part:
“An attorney or other agent of the judgment creditor who receives payment from the judgment debtor ... is not liable if the judgment was valid before reversal and if he had no knowledge of any fraud used in securing it. Under the same conditions he is under no duty to repay money which he received on account of the judgment creditor and which he retains as payment for services or for a debt [877]*877owed by the judgment creditor to him . . . since he received the money as a bona fide purchaser.”16
Cases from other jurisdictions taking essentially this view have held that an attorney acting in good faith is not required to restore monies paid to the attorney in satisfaction of a valid debt incurred for legal services rendered, which monies were received from the opposing party pursuant to a judgment that is subsequently reversed. See Wall v. Johnson, 80 So. 2d 362 (Fla. 1955); Martin v. Lenahan, 658 So. 2d 119 (Fla. Ct. App. 1995); Lowenstein v. Reikes, 258 N.Y. 444 (1932); Munitz v. Munitz, 132 N.Y.S.2d 644 (1954); Herkert v. Stauber, 127 Wis. 2d 87 (1985). See also Abrahami v. U.P.C. Constr. Co., Inc., 248 A.D.2d 272 (N.Y. 1998) (where investors won fraud suit at trial but lost on appeal, investors’ lawyers were required to make restitution of that portion of funds representing a contingent fee retained in connection with the matter but not for disbursements retained or made to third parties for client debts); 7 Am. Jur. 2d Attorney at Law § 252 (1997).
Comment k to Restatement § 74, entitled “Restitution against other parties,” articulates an exception to the rule exempting third parties from a repayment obligation where the third party is the real party in interest:
“After the reversal of a judgment any person who, although not a party to the action, was a real party in interest and who received payment in whole or in part as the beneficial owner or as one of several owners, is under a duty to restore the amount received by him.”17
Those courts that have required the attorney to make restitu-[878]*878tian after the judgment is reversed, whether in reliance on comment k or otherwise, typically involve circumstances where the attorney’s right to and scope of compensation is contingent upon the client’s ultimate success (e.g., a contingency fee arrangement), but some also take into consideration whether the attorney had clear notice regarding the consequences of the appeal (e.g., payment of the monies under explicit protest or a rule codifying a duty to restore). See Mohamed v. Kerr, 91 F.3d 1124 (8th Cir. 1996); Berger v. Dixon & Snow, P.C., 868 P.2d 1149 (Colo. App. 1994); Excel Corp. v. Jiminez, 269 Kan. 291 (2000); Champion Intl. Corp. v. McChesney, 239 Mont. 287 (1989); Abrahami, supra; Transamerica Ins. Group v. Adams, 62 Or. App. 419 (1983). See also Waggoner v. Glacier Colony of Hutterites, 131 Mont. 525 (1957); Bruns v. Mattocks, 6 NJ. Super. 174 (1950); Pincus v. Pincus, 211 A.D. 128 (N.Y. 1924); Baker v. Baker, 17 A.D.2d 924 (N.Y. 1962); In re Marriage of Mason, 48 Wash. App. 688 (1987). Notably, many of the foregoing cases also involve the active participation of the attorney in the appeal and related proceedings.18
[879]*879While not all of the cited cases reaching the same result can easily be reconciled, we think it is sensible to sort third parties, as the Restatement § 74 does, into two categories: bona fide creditors of the judgment creditor (not liable in restitution) and real parties in interest (liable in restitution). We also think it sensible, when the third party is an attorney, that the nature of the fee arrangement should be a chief consideration in determining the category into which the third party falls. As stated in the Restatement (Third) § 18 comment g:
“[A] lawyer who receives a share of a judgment pursuant to a contingent-fee [sic] arrangement does not take the money as a bona fide creditor of the judgment creditor, notwithstanding that the lawyer takes die money in good faith. Between lawyer and client, in such circumstances, the lawyer assumes the risk of nonrecovery: this makes the lawyer, not the client’s creditor, but the assignee pro tanto [sic] of the client’s judgment.”
See Mohamed v. Kerr, 91 F.3d at 1126. Otherwise put, a lawyer who has a fee for legal services rendered arrangement is entitled to payment of the fee irrespective of the client’s ultimate success and any unpaid counsel fees remain the client’s debt obligation.
We are in accord with the Restatement position that a bona fide creditor who in good faith receives payment from the proceeds of a judgment favoring his debtor is not liable in restitution to the person or entity whose payment satisfied the judgment when the judgment is reversed. Because the bona fide creditor is entitled to payment regardless of the judgment’s validity, that creditor is not unjustly enriched by retention of the payment after the judgment’s reversal.
Applying that principle to payments an attorney receives from the proceeds of a judgment favoring the attorney’s client, we conclude that the attorney is not liable in restitution to the judgment debtor upon reversal of the judgment unless the judg[880]*880ment debtor, on remand, proves either that the payment did not discharge an unconditional, bona fide obligation the client had to the attorney or that, although the payment did discharge such an obligation, other circumstances exist that make the attorney’s retention of the payment unjust.19 The foregoing principle applies at least when, as here, the attorney receives the payment directly from an opposing party pursuant to a court order.20
IV. Application. In applying on remand the principle just described, several considerations will merit attention.21 The first such consideration is the nature of the fee arrangement between the wife and Mr. Mahlowitz, and the impact that the husband’s payment to Mr. Mahlowitz had on any bona fide debt existing pursuant to the lawyer-client arrangement at the time of payment. In that regard, we recognize that Mass.R.Prof.C. 1.5(d)(1), as amended, 432 Mass. 1301 (2000), prohibits contingent fees in divorce cases and that Mr. Mahlowitz submitted hourly time records in support of his motions for an award of counsel fees. If the husband cannot make a satisfactory evi-dentiary showing that his payment to Mr. Mahlowitz performed some function other than the unconditional discharge of a debt for hourly legal services rendered to the wife, then Mr. Mahlo-witz is to that extent a bona fide creditor.
The second consideration has to do with Mr. Mahlowitz’s conduct of the litigation that generated the aforesaid debt for legal fees. Although the motion judge indicated the absence of any unethical or improper conduct on Mr. Mahlowitz’s part, he nonetheless alluded to a statement in our memorandum and order characterizing the allegations in the rule 60(b) motion Mr. Mahlowitz filed on the wife’s behalf as, “at the very least, inexplicable.” Allowance of that motion, of course, generated a significant portion of the litigation in connection with which the [881]*881fees were awarded. It may be that the circumstances surrounding Mr. Mahlowitz’s filing of the motion will bear on whether, satisfaction of his client’s unconditional obligation notwithstanding, it would be inequitable, at least as between Mr. Mahlowitz and the husband, to allow Mr. Mahlowitz to retain the amount the husband paid to Mr. Mahlowitz for attorney’s fees.22
Should the judge on remand determine that Mr. Mahlowitz’s conduct of the litigation was such that equity would require him to restore to the husband some portion of the husband’s payment for legal fees, the matter would not be at an end; a further consideration would then come into play. Any such repayment to the husband would be subject to the wife’s right to show, and, thus, to Mr. Mahlowitz’s right to show on her behalf, that her retention of the benefits of the husband’s payment to Mr. Mahlowitz does not constitute unjust enrichment. See Restatement § 74. It appears, for example, that a portion of the payment was designed to cover the wife’s attorney’s fees resulting from the husband’s contumacious conduct. See Hennessey v. Sarkis, 54 Mass. App. Ct. 152, 156-157 (2002). As noted earlier, another portion of the fee may have been awarded under G. L. c. 208, § 38, a statute that is not predominantly success driven but is instead designed to level the playing field and allow both sides access to capable legal representation in divorce litigation. See Kindregan & Inker, Family Law and Practice § 6.1 (1996); Nelon v. Nelon, 329 Mass. 643 (1953); Kelly v. Kelly, 374 Mass. 826, 827 (1978); Brash v. Brash, 407 Mass. 101, 107 (1990) ; Peterson v. Peterson, 30 Mass. App. Ct. 932, 934 (1991) . See also G. L. c. 208, § 17. Repayment of portions of the fee awarded under either theory would appear not to be necessary in order to avoid the wife’s unjust enrichment and, if [882]*882so, Mr. Mahlowitz’s retention of such portions of the fee award would likewise not be inequitable.23
V. Conclusion. We do not suggest that the aforesaid considerations on remand are necessarily exhaustive. There may well be other pertinent factors suggested in the cases that the judge may consider in determining whether Mr. Mahlowitz will be unjustly enriched if permitted to retain the court-awarded fees. The order requiring Mr. Mahlowitz to repay the husband $31,07524 is vacated and the matter is remanded for further proceedings not inconsistent with this opinion.
So ordered.