
394 S.C. 134 (2011)
714 S.E.2d 532
MATRIX FINANCIAL SERVICES CORPORATION, Respondent,
v.
Louis M. FRAZER, Linda S. Frazer, Matthew Kundinger, and Parks Grove Homeowners Association, Inc., Defendants,
Of whom Matthew Kundinger is the, Appellant.
No. 26859.
Supreme Court of South Carolina.
Heard April 21, 2009.
Re-filed August 8, 2011.
*135 David Alan Wilson, of Horton Drawdy Ward & Jenkins, of Greenville, and Edward Scott Sanders, of Greenville, for Appellant.
Earle G. Prevost and Michael J. Giese, both of Leatherwood Walker Todd & Mann, of Greenville, for Respondent.
Chief Justice TOAL.
Matthew Kundinger (Appellant) enrolled a default judgment against Louis and Linda Frazer (the Frazers) before the Frazers closed a refinance mortgage with Matrix Financial Services Corporation (Matrix). In Matrix's foreclosure action, the master-in-equity granted Matrix equitable subrogation, giving the refinance mortgage priority over Appellant's judgment lien. We certified the case pursuant to Rule 204(b), *136 SCACR, and reversed in Matrix Financial Services Corp. v. Frazer, No. 26859, 2010 WL 3219472 (S.C.Sup.Ct. Aug.16, 2010). This Court granted a petition for rehearing and we now withdraw that opinion and substitute this opinion, which also reverses the master-in-equity's grant of equitable subrogation.

FACTS/PROCEDURAL BACKGROUND
In 1998, Appellant brought suit against the Frazers in California. In 2000, the Frazers moved to South Carolina, and defaulted in Appellant's California lawsuit.
In January 2001, the Frazers purchased a home in Greenville County. That mortgage was assigned to Matrix in June 2001. In September 2001, Matrix and the Frazers entered into a loan commitment to refinance the January 2001 mortgage. A title search was conducted on September 18, 2001. The parties closed the refinance loan on November 26, 2001, but the new mortgage was not recorded until April 3, 2002.
Meanwhile, on September 4, 2001, Appellant obtained a default judgment against the Frazers in California, and enrolled that judgment in Greenville County on October 31, 2001.
The Frazers filed bankruptcy, and Matrix sought to foreclose its November 2001 refinance mortgage. Appellant counterclaimed, alleging his judgment had priority over Matrix's mortgage because it had been recorded first. Matrix, attempting to gain the primary priority position, then sought to have the refinance mortgage equitably subrogated to the rights of the January 2001 mortgage. The master-in-equity granted Matrix's request, and Appellant appeals that order.

ISSUES
I. Did the master-in-equity err in granting Matrix equitable subrogation to the rights of the January 2001 mortgage, giving Matrix priority over Appellant's judgment lien?
II. Does the doctrine of unclean hands prevent Matrix from receiving the remedy of equitable subrogation?


*137 ANALYSIS

I. Equitable Subrogation
Appellant argues the master-in-equity erred in holding Matrix was entitled to equitable subrogation. We agree.
The requirements a mortgagee must meet to qualify for equitable subrogation are: (1) the party claiming subrogation has paid the debt; (2) the party was not a volunteer, but had a direct interest in the discharge of the debt or lien; (3) the party was secondarily liable for the debt or for the discharge of the lien; (4) no injustice will be done to the other party by the allowance of equitable subrogation; and (5) the party asserting the doctrine did not have actual notice of the prior mortgage. Dedes v. Strickland, 307 S.C. 155, 158, 414 S.E.2d 134, 136 (1992).
In Dedes, a bank refinanced its initial mortgage and sought to be equitably subrogated to the rights of that mortgage to gain priority over the rights of an intervening mortgagee. The Court held that the bank could not meet the elements of equitable subrogation because it merely paid "itself [the] outstanding debt by refinancing the balance owed" and had no "direct interest necessitating discharge of the debt...." Id. at 159, 414 S.E.2d at 136. The Court further stated, "The record is silent as to what secondary liability [the bank] could have had for [the mortgagor's] debt secured by its own first mortgage lien." Id. While the Dedes Court appears to have conflated the requirements of secondary liability and a direct interest in discharging the debt,[1] the heart of its reasoning was that the bank could not be subrogated to the rights of its *138 own prior mortgage. This conclusion comports with the general view that equitable subrogation contemplates a third party satisfying the original mortgage, not the same party to whom the original debt is owed. See Restatement (Third) of Property (Mortgages) § 7.6 cmt.e (1995) ("Obviously subrogation cannot be involved unless the second loan is made by a different lender than the holder of the first mortgage; one cannot be subrogated to one's own previous mortgage."); Black's Law Dictionary (9th ed. 2009) ("Subrogation: The substitution of one party for another whose debt the party pays, entitling the paying party to rights, remedies, or securities that would otherwise belong to the debtor.").
Thus, equitable subrogation is simply not a remedy available to a lender that refinances the original debt owed to it. This seems to yield the proper result, as opposed to the mangled logic that comes about when reasoning that a lender refinancing the original debt owed to it cannot prove secondary liability or a direct interest in discharging the debt. Matrix is not asserting priority under a theory of replacement and modification. Matrix expressly pled equitable subrogation in its reply to Appellant's counterclaim. Both Dedes, controlling South Carolina precedent, and section 7.6 of the Restatement stand for the proposition that a lender that refinances its own debt is not entitled to equitable subrogation. We do not decide whether a lender that refinances its own debt could attain priority under the theory of replacement and modification illustrated in section 7.3 of the Restatement (Third) of Property (Mortgages).

II. Unclean Hands
Appellant also argues Matrix is not entitled to an equitable remedy because it closed the refinance loan unlawfully, and thus has unclean hands. We do not believe the doctrine of unclean hands is the appropriate basis for resolution of this case. However, we do agree that even if Matrix met the requirements for equitable subrogation, Matrix would be precluded from receiving that remedy because of its unauthorized practice of law.
All real estate and mortgage loan closings must be supervised by an attorney. Doe v. McMaster, 355 S.C. 306, *139 585 S.E.2d 773 (2003); State v. Buyers Serv. Co., 292 S.C. 426, 357 S.E.2d 15 (1987). Performing a title search, preparing title and loan documents, and closing a loan without the supervision of an attorney constitutes the unauthorized practice of law. Buyers Serv., 292 S.C. at 430-34, 357 S.E.2d at 17-19.
In Wachovia Bank v. Coffey, 389 S.C. 68, 698 S.E.2d 244 (Ct.App.2010), Wachovia closed a home equity loan without the supervision of an attorney and later instituted foreclosure proceedings. Our court of appeals held that Wachovia, having committed the unauthorized practice of law in closing the loan without attorney supervision, came to the court with unclean hands and thus was barred from seeking equitable relief. In so holding, the court of appeals said:
The unauthorized practice of law is inherently prejudicial to not only the parties involved in the instant transaction but also to the public at large for the reason so cogently stated in Buyers:

The reason preparation of instruments by lay persons must be held to constitute the unauthorized practice of law is not for the economic protection of the legal profession. Rather, it is for the protection of the public from the potentially severe economic and emotional consequences which may flow from erroneous advice given by persons untrained in the law.
Coffey, 389 S.C. at 76, 698 S.E.2d at 248 (citing State v. Buyers Serv. Co., 292 S.C. 426, 431, 357 S.E.2d 15, 18 (1987)).
Similarly, in this case Matrix hired LandAmerica OneStop to perform the title search, prepare the documents, and close the refinance loanall admittedly without the supervision of a licensed attorney. Thus, Matrix committed the unauthorized practice of law in closing the refinance mortgage, clearly violating South Carolina law.[2] Matrix now comes to this *140 Court, seeking equitable relief, based upon a mortgage contract it entered into in violation of the laws of this state.
This Court has previously held the presence of attorneys in real estate loan closings is for the protection of the public and that "protection of the public is of paramount concern" in loan closings. Buyers Serv., 292 S.C. at 433, 357 S.E.2d at 19. Enforcing this requirement will come as no surprise to any lender. Lenders cannot ignore established laws of this state and yet expect this Court to overlook their unlawful disregard. We take this opportunity to definitively state that a lender may not enjoy the benefit of equitable remedies when that lender failed to have attorney supervision during the loan process as required by our law. We apply this ruling to all filing dates after the issuance of this opinion.

CONCLUSION
For the above reasons, we hold Matrix is not entitled to equitable subrogation. The master-in-equity's order is
REVERSED.
BEATTY, J., and Acting Justice JOHN H. WALLER, JR., concur. KITTREDGE, J., concurring in result in a separate opinion. PLEICONES, J., dissenting in a separate opinion.
Justice KITTREDGE.
I concur in result. I join Chief Justice Toal and vote to reverse due to Matrix's unauthorized practice of law. I would not reach the issue of whether Matrix otherwise satisfied the requirements of equitable subrogation. Concerning the majority's broader holding voiding a real estate mortgage secured through the unauthorized practice of law, I join today's result because of its prospective-only application.
*141 Justice PLEICONES.
I respectfully dissent. I would affirm the master's order equitably subrogating Matrix's refinanced mortgage to its original mortgage, and would not impose the draconian remedy of denying equitable relief to lenders who "fail[...]to have attorney supervision during the loan process as required by law."

A. Equitable Subrogation

Equitable subrogation is a remedy favored by the courts, and it is to be liberally and expansively applied. So. Bank and Trust Co. v. Harrison Sales Co., Inc., 285 S.C. 50, 328 S.E.2d 66 (1985). The doctrine:
is founded on the fictional premise that an obligation extinguished by a payment made by a third person is to be treated as still subsisting for the benefit of such third person, whereby he is substituted to the rights of the creditor when he has made such payment.

St. Paul-Mercury Indem. Co. v. Donaldson, 225 S.C. 476, 83 S.E.2d 159 (1954) citing Aetna Life Ins. Co. of Hartford v. Town of Middleport, 124 U.S. 534, 8 S.Ct. 625, 31 L.Ed. 537 (1888).
"The purpose of subrogation is to prevent a junior lien holder from converting the mistake of the lender into a magical gift for himself." United States v. Baran, 996 F.2d 25 (2nd Cir.1993) (internal citation omitted).
It appears that the majority would agree with me that a refinancer has a right to lien priority, if that refinancer uses the theory of "replacement and modification" rather than equitable subrogation. Heretofore, South Carolina has used the doctrine of equitable subrogation to restore a refinancer's lien to priority, and I would not reverse this order because it used this theory rather than the newly announced "replacement and modification" rule.
In 1927, this Court held that a lender who pays the original mortgage itself, or furnishes money to the mortgagor to pay off an existing mortgage, pursuant to an agreement by which the lender will give a new mortgage, has the equitable right to be subrogated to the paid-off mortgage. Enterprise Bank v. Fed. Land Bank, 139 S.C. 397, 138 S.E. 146 (1927). In this *142 situation, the lender furnishing the money is not a volunteer, and becomes secondarily liable for the discharge of the first mortgage under the instruments creating the new mortgage which require the satisfaction of the first mortgage as a condition of the giving of the second. Id.;[3]see also James v. Martin, 150 S.C. 75, 147 S.E. 752 (1929) (applying Enterprise Bank and quoting: One satisfying a lien note at the request of the property owner, upon the understanding that he is to have new security upon the property released, acting in ignorance of a second mortgage lien upon the property, although it is on record, is entitled to subrogation to the rights of the first lien holder?).
As the Washington Supreme Court explained, several considerations support a rule that, absent material prejudice to a junior lienholder, equitable subrogation should be automatically available to a mortgage refinancer who can show it expected to have first priority:
1) Equitable subrogation preserves priorities by keeping mortgages and other liens in their proper recordation order;
2) Equitable subrogation accomplishes substantial justice and rests on the maxim that no one (here, the junior lienholder) should be enriched by another's loss;
3) Facilitating refinancing helps prevent foreclosures; and
4) A liberal equitable subrogation policy reduces title insurance premiums.[4]

Bank of America v. Prestance Corp., 160 Wash.2d 560, 160 P.3d 17 (2007).
The majority would punish the respondent in this case for failing to anticipate the majority's decision to alter the theory under which respondent pled, proved, and obtained the result it sought below. I would affirm the master's decision to equitably subrogate Matrix's second mortgage to its first, a *143 result which is consistent with both our existing law and sound public policy. Cf. Rule 220(c), SCACR (court may affirm for any reason appearing in the record).

B. Unclean Hands

The majority also would expand the relief afforded by the Court of Appeals to a mortgagor who has been the "victim of the unauthorized practice of law" to all lienholders of that mortgagor. See Wachovia Bank v. Coffey, 389 S.C. 68, 698 S.E.2d 244 (Ct.App.2010) cert. pending (mortgagee cannot foreclose mortgage where loan closed without attorney supervision); compare Hambrick v. GMAC Mort. Corp., 370 S.C. 118, 634 S.E.2d 5 (Ct.App.2006) cert. dismissed April 5, 2007 (mortgagor has no private right of action against mortgagee for the unauthorized practice of law). The purpose of equitable subrogation/replacement and modification is to prevent a windfall to a junior lienholder. I cannot square the policy underlying this purpose with the Court's proclamation that refusing equitable relief to "bad" lenders will somehow protect the public at loan closings. I see only detriment to the borrowing public[5] and a windfall to junior lienholders in this decision which would deny all equitable relief to any "lender who fail[s] to have attorney supervision during the loan process as required by our law ... [in] all filing dates[6] after the issuance of this opinion."

CONCLUSION
I respectfully dissent and would affirm the Master's order.
NOTES
[1]  The logic surrounding the elements of secondary liability and direct interest has been tortured in our case law because the current definition does not distinguish between a party who pays off the prior debt and a party who advances funds to the debtor for the purpose of paying off the prior debt. Judge Howard's concurrence in Dodge City of Spartanburg, Inc. v. Jones, 317 S.C. 491, 454 S.E.2d 918 (Ct.App.1995), explains the difficulties our courts have encountered concerning this issue. While we disagree with Judge Howard's conclusion that the lender in Dodge City could receive equitable subrogation when it refinanced the debt already owed to it, we agree with his analysis that a lender who either pays the debt itself or provides the debtor funds with the understanding the debtor will satisfy the obligation may seek equitable subrogation.
[2]  Buyers Service established in 1987 that attorney supervision is required for the four steps in the residential real estate loan and mortgage process: preparation of deeds, notes, and other instruments; preparation of title abstracts; the closing; and recording the instruments. 292 S.C. at 430-34, 357 S.E.2d at 17-19. No language, analysis, or discussion in Buyers Service indicates the Court intended to limit the holding to purchase money mortgages. In Doe v. McMaster, the petitioner suggested to the Court that Buyers Service's holding did not apply because the buyer and lender were refinancing an existing mortgage rather than purchasing new property. 355 S.C. at 312, 585 S.E.2d at 776. The Court said, "This distinction is without significance" because "[i]n refinancing a real estate mortgage the four steps in the initial purchase still exist." Id. Doe v. McMaster did not change the landscape regarding refinance loans, but simply stated the existing law.
[3]  It appears that the lender in Dedes v. Strickland, 307 S.C. 155, 414 S.E.2d 134 (1992) was denied equitable subrogation because it failed to present evidence that its refinancing was conditioned upon the repayment of the first loan. Id. at 159, 414 S.E.2d at 136.
[4]  Citing Nelson & Whitman, Adopting Restatement Mortgage Subrogation Principles: Saving Billions of Dollars for Refinancing Homeowners, 2006 BYU L.Rev. 305.
[5]  I suspect that many mortgagees, denied hope of equitable relief, including the ability to foreclose if an attorney should fail to supervise any of the acts required of him in a loan closing, will choose not to do business in South Carolina, or choose to increase fees to cover potential unrecoverable liabilities.
[6]  I am unsure what filing date the majority is referring to in this passage.
