Document:

Exhibit

EXHIBIT 10.39

EXECUTION VERSION

MARGIN, SETOFF AND NETTING AGREEMENT
THIS MARGIN, SETOFF AND NETTING AGREEMENT, dated as of February 14, 2019 (as amended, restated, supplemented or otherwise modified from time to time, this “Agreement”), is made collectively among (i) BARCLAYS BANK PLC (“Barclays”), as Administrative Agent (as defined in the Master Refinancing Agreement referred to below) (in such capacity, the “Administrative Agent”), for the benefit of Buyer Group (as defined below), (ii) BARCLAYS, as a Repo Buyer (as defined below), (iii) NOMURA CORPORATE FUNDING AMERICAS, LLC (“Nomura”), as a Repo Buyer, (iv) BARCLAYS CAPITAL INC. (“Barclays Capital”), as an MSFTA Counterparty (as defined below), (v) NOMURA SECURITIES INTERNATIONAL, INC. (“Nomura Securities”), as an MSFTA Counterparty, (vi) DITECH FINANCIAL LLC (“Ditech”), (vii) REVERSE MORTGAGE SOLUTIONS, INC. (“RMS”), and (viii) RMS REO BRC II, LLC (the “REO Subsidiary” and, together with Ditech and RMS, the “Sellers”), and acknowledged and agreed to by DITECH HOLDING CORPORATION (“Guarantor”).
R E C I T A L S:
WHEREAS, on February 11, 2019, the Guarantor, Ditech, RMS and certain of their Affiliates filed the Cases in the Bankruptcy Court (as such terms are defined in the Master Refinancing Agreement);
WHEREAS, in connection with the Cases, the Sellers and certain of their Affiliates propose to refinance and replace in full the facilities contained in the Prepetition Warehouse Facility Agreements (as defined in the Master Refinancing Agreement);
WHEREAS, concurrently with the effectiveness of this Agreement, the Administrative Agent, Guarantor, and the Sellers are entering into that certain Master Refinancing Agreement, dated as of the Effective Date (as defined therein) (as amended, restated, supplemented or otherwise modified from time to time, the “Master Refinancing Agreement”), among the Administrative Agent, the Guarantor, the Seller Parties, the Buyers (as defined therein) party thereto from time to time, and the MSFTA Counterparties (as defined therein);
WHEREAS, concurrently with the effectiveness of this Agreement, the Sellers party thereto are entering into the Repurchase Agreements and the MSFTAs (as such terms are defined in the Master Refinancing Agreement);
WHEREAS, from time to time, the Repo Buyers (and/or Administrative Agent on behalf of the Repo Buyers) have engaged and may continue to engage in transactions under the Repurchase Agreements with any Seller;  
WHEREAS, from time to time, the MSFTA Counterparties have engaged and may continue to engage in transactions under the MSFTAs with Ditech; and
WHEREAS, as a condition precedent to the effectiveness of the Master Refinancing Agreement and providing the funding contemplated by the Repurchase Agreements and MSFTAs, 

2014057.06-NYCSR07A - MSW

as applicable, the Administrative Agent, the Repo Buyers and MSFTA Counterparties have required the Sellers to permit netting and setoff rights to the Administrative Agent, for the benefit of the Buyer Group.
NOW, THEREFORE, in consideration of the foregoing premises, to induce the Administrative Agent, the Repo Buyers and the MSFTA Counterparties, as applicable, to enter into the Master Refinancing Agreement, the Repurchase Agreements and the MSFTAs and transactions thereunder, and for other good and valuable consideration, the receipt and sufficiency of which are hereby acknowledged, the parties hereto hereby agree as follows:
A G R E E M E N T:
Section 1.    Definitions.  Unless otherwise defined herein, capitalized terms which are defined in the Master Refinancing Agreement and used herein are so used as so defined.  As used herein, the following terms shall have the following meanings (all terms defined in this Section 1 or in other provisions of this Agreement in the singular to have the same meanings when used in the plural and vice versa).
“Activity” shall mean all transactions (including Clearing Transactions), confirmations and agreements under a Repurchase Agreement, an MSFTA or any related Governing Agreement, whenever arising.
“Administrative Agent” shall have the meaning set forth in the Preamble.
“Agreement” shall have the meaning set forth in the Preamble.
“Barclays” shall have the meaning set forth in the Preamble.
“Barclays Capital” shall have the meaning set forth in the Preamble.
“Bankruptcy Code” shall mean title 11 of the United States Code, 11 U.S.C. § 101, et seq., as amended from time to time.
“Buyer Entity” shall mean, individually, any of the following: (a) the Administrative Agent, (b) Barclays, (c) Barclays Capital, as an MSFTA Counterparty, (d) Nomura, (e) Nomura Securities, as an MSFTA Counterparty, (f) any other Repo Buyer, (g) any other MSFTA Counterparty, and (h) any parent, subsidiary or Affiliate of any of the foregoing. 
“Buyer Group” shall mean, collectively, (a) the Administrative Agent, (b) Barclays, (c) Barclays Capital, as an MSFTA Counterparty, (d) Nomura, (e) Nomura Securities, as an MSFTA Counterparty, (f) each other Repo Buyer, (g) each other MSFTA Counterparty, and (h) any parent, subsidiary or Affiliate of any of the foregoing, to the extent any of the foregoing are owed any Obligations or are party to any of the Governing Agreements (but not in their capacity as a Buyer under any Indenture). 
“Clearing Transaction” shall mean all actions, agreements, promises of performance and transactions including, but not limited to, any transaction under or related to a Governing 

2
2014057.06-NYCSR07A - MSW

Agreement, relating to the execution, clearance, settlement of transactions in or the maintenance of accounts for the purpose of carrying, holding or financing positions in, securities, loans (including whole mortgage loans and bank debt), currencies, commodities or derivatives, in each case, for a Seller by any Buyer Entity in the Buyer Group and all transactions in which any Buyer Entity in the Buyer Group provides clearing, fixed income clearing, custody or settlement services to or for a Seller (including as prime broker in connection with prime broker transactions or fixed income clearing transactions, or in connection with any give-up, free delivery or unsettled transaction, or when acting as a clearance and/or settlement agent in any clearing system, market, or exchange, domestic or international) or transactions in, or the custody of, cash made in connection with, or in contemplation of, any of the foregoing.
“Ditech” shall have the meaning set forth in the Preamble.
“Effective Date” shall have the meaning assigned to such term in the Master Refinancing Agreement.
“Event of Default” shall have the meaning, with respect to each Governing Agreement, assigned to such term in such Governing Agreement. 
“FDICIA” shall have the meaning assigned to such term in Section 12.
“Governing Agreements” shall mean, collectively, (a) each MSFTA, (b) each Repurchase Agreement, (c) the Master Refinancing Agreement, and (d) the Depositor Equity Pledge Agreement.  For the avoidance of doubt, at no time shall any of the following constitute a “Governing Agreement” hereunder: (i) any Prepetition 1L/2L Document, (ii) any Indenture or (iii) any other “Transaction Document” as defined in each Indenture not specified above.
“Guarantor” shall have the meaning set forth in the Preamble.
“Margin” shall have the meaning assigned to such term in Section 2.
“Master Refinancing Agreement” shall have the meaning assigned to such term in the Recitals.
“Nomura” shall have the meaning set forth in the Preamble.
“Nomura Securities” shall have the meaning set forth in the Preamble.
“NYUCC” shall mean the Uniform Commercial Code as adopted in the State of New York as in effect from time to time. The following terms used in this Agreement shall have the same meanings herein as set forth in the NYUCC: “Account,” “Chattel Paper,” “Commodity Account,” “Commodity Contract,” “Deposit Account,” “Document,” “Financial Asset,” “General Intangible,” “Instrument,” “Investment Property,” “Letter-of-Credit Right,” “Proceeds,” “Securities Account,” “Securities Intermediary,” “Security” and “Security Entitlement.”
“Obligations” shall mean, collectively, (a) the “Obligations” (as defined in each of the Repurchase Agreements), (b) the “Secured Obligations” (as defined in each of the MSFTAs), 

3
2014057.06-NYCSR07A - MSW

and (c) any other obligations or liabilities of any Seller to any Buyer Entity in the Buyer Group under this Agreement and the Master Refinancing Agreement.  For the avoidance of doubt, at no time shall obligations or liabilities under or with respect to any of the following constitute a “Obligations” hereunder: (i) any Prepetition 1L/2L Document, (ii) any Indenture or (iii) any other “Transaction Document” as defined in each Indenture not specified above.
“Party” shall mean each Seller and the Buyer Group.
“Person” shall mean an individual, corporation, trust, business trust, statutory trust, partnership, limited liability company, joint venture or similar business association.
“REO Subsidiary” shall have the meaning set forth in the Preamble.
“Required Buyers” shall have the meaning assigned to such term in the Administration Agreement.
“Repo Buyers” shall mean, collectively, (a) each “Buyer” under and as defined in the Ditech Repurchase Agreement, (b) each “Purchaser” under and as defined in the RMS Repurchase Agreement and (c) each other Buyer under a Repurchase Agreement.
“RMS” shall have the meaning set forth in the Preamble.
“Sellers” shall have the meaning set forth in the Preamble.
Section 2.    Security Interest.  Each Seller hereby grants, collaterally assigns and pledges to the Administrative Agent, for the benefit of each Buyer Entity, as security and margin for the payment and performance of all Obligations of each Seller to any Buyer Entity in the Buyer Group a security interest in all of such Seller’s rights, interests and title, if any, to in or under the following, whether now owned or hereafter acquired, now existing or hereafter created:  (a) each Deposit Account, Securities Account or other trust or custodial account maintained for any Seller by or with any Buyer Entity in the Buyer Group pursuant to a Governing Agreement or any related Program Agreement; (b) all property (including Security Entitlements) now or hereafter credited to or held in any such account or otherwise held, or carried by or through, or subject to the control of any Buyer Entity in the Buyer Group or agent thereof in connection with a Governing Agreement whether fully paid or otherwise; (c) all rights under the Governing Agreements and any related Program Agreements, including, without limitation, all rights of any Seller in any obligation of any Buyer Entity in the Buyer Group and all rights of any Seller in or to any Activity in connection with a Governing Agreement or any related Program Agreement; (d) all Accounts, Chattel Paper, Commodity Accounts, Commodity Contracts, Documents, General Intangibles, Instruments, Investment Property, Letter-of-Credit Rights and Securities held under or constituting collateral or security under or pursuant to any Governing Agreement or any related Program Agreement (including any “Pledged Collateral” as defined in the Depositor Equity Pledge Agreement); and (e) all Proceeds of or distributions on any of the foregoing (collectively, clauses (a) through (e) (“Margin”)). The description of any property that is Margin contained in any Activity is incorporated into this Agreement as if fully set forth herein and constitutes Margin hereunder. In addition to any other provisions, obligations or understandings of the Sellers under any Governing Agreement, or 

4
2014057.06-NYCSR07A - MSW

otherwise, each Seller hereby acknowledges and agrees that the foregoing grant is intended to use each Seller’s Margin as security (limited to the Margin pledged by each Seller unless any Seller provides additional recourse in any Governing Agreement or elsewhere) for any Seller’s Obligations.  Without limiting the characterization of this Agreement as a master netting agreement, the grant herein is intended to constitute a security agreement or other arrangement or other credit enhancement related to this Agreement and Activities under the Governing Agreements as defined under Sections 101(47)(A)(v), 101(25)(E), 101(38A)(A), (101)(53B)(A)(vi), and 741(7)(A)(xi), 761(4)(J), of the Bankruptcy Code. 
Section 3.    Margin for All Obligations.  Notwithstanding any provision to the contrary contained in any Governing Agreement or related Program Agreement, all Margin pledged by any Seller to any Buyer Entity in the Buyer Group, whether under this Agreement, any other Governing Agreement  or any related Program Agreement shall be and shall constitute, to the fullest extent of any rights of each Seller in such assets, Margin pledged by each Seller under and in connection with this Agreement and each other Governing Agreement, to margin and secure all of the Obligations, each Activity, and each Governing Agreement.  Each Activity, whenever entered into, shall be deemed amended accordingly. Each Seller and the Buyer Group each acknowledges and agrees that any Buyer Entity as the secured party may hold any Margin as agent or bailee for the Administrative Agent, for the benefit of all of the Buyer Entities in the Buyer Group.
Section 4.    Periodic Netting and Setoff.  Effective as of the Effective Date and until the termination of all Governing Agreements and payment in full in cash of the Obligations, the Administrative Agent (at the direction of the Required Buyers or otherwise in accordance with the Administration Agreement) shall have the right, for so long as an Event of Default is continuing under any Governing Agreement and subject to Article 6 of the Master Refinancing Agreement, to aggregate, setoff, foreclose and net any Obligations and Activities with any Margin.  The parties specifically agree that, for so long as an Event of Default is continuing under any Governing Agreement, netting in respect of two or more Obligations and/or Activities with any Margin may occur upon the election of the Administrative Agent (at the direction of the Required Buyers or otherwise in accordance with the Administration Agreement).  This periodic netting process shall be conducted in accordance with the provisions of this Section 4 for all Margin and any or all Obligations and/or Activities.  Accordingly, for so long as an Event of Default under any Governing Agreement is continuing and subject to Article 6 of the Master Refinancing Agreement: 
(a)    If any Seller owes any due and payable Obligation to any Buyer Entity in the Buyer Group, the Administrative Agent (at the direction of the Required Buyers or otherwise in accordance with the Administration Agreement) may, aggregate, setoff, foreclose and net:  (i) any Margin pledged by any Seller to Administrative Agent or any Buyer Entity in the Buyer Group or held or carried for any Seller by any Buyer Entity in the Buyer Group; and (ii) any Margin required to be paid or returned by Administrative Agent or any Buyer Entity in the Buyer Group to Seller. 
(b)    All payments due pursuant to this Section 4 shall be made on the payment date, which shall be no later than the first business day after the netting.  All payments shall be made by wire transfer in accordance with the applicable Governing Agreements.  

5
2014057.06-NYCSR07A - MSW

(c)    Upon making such net payment and/or delivery, and provided that the Margin subject to such Obligations has been returned (if required) properly to the appropriate Buyer Entity in the Buyer Group and that all other obligations of the parties hereto have been satisfied, such Buyer Entity agrees to reflect on its books and records that such netted Obligations have been discharged fully. 
(d)    The Administrative Agent, on behalf of each Buyer Entity in the Buyer Group, may collect from any Seller any losses, reasonable costs or expenses incurred by any Buyer Entity in the Buyer Group in accordance with the applicable Governing Agreements or hereunder in taking any of the above‐mentioned actions (including commissions (other than commissions payable to any entity belonging to the Buyer Group) and reasonable legal fees and expenses), all of which will be secured by Margin.  Any other Buyer Entity in the Buyer Group shall promptly notify the Administrative Agent of any such losses, costs or expenses so incurred.
Section 5.    Buyer Entities May Act Through Administrative Agent.  Each Buyer Entity in the Buyer Group has designated the Administrative Agent for the purpose of performing any action hereunder.  The exculpatory and liability-limiting provisions contained in the Administration Agreement with respect to the Administrative Agent shall also apply in all respects to the Administrative Agent hereunder and under the other Governing Agreements.
Section 6.    Remedies.   
(a)    At any time while an Event of Default under any Governing Agreement is continuing, subject to Article 5 of the Master Refinancing Agreement, the Administrative Agent may exercise any and all rights and remedies of a secured party or otherwise, including, without limitation, the following: (i) immediately sell, without demand or further notice of any kind, at a public or private sale and at such price or prices as Administrative Agent may deem satisfactory any or all Margin hereunder and apply the proceeds thereof to the Obligations and any other amounts owing by a Seller hereunder or (ii) in its sole discretion elect, in lieu of selling all or a portion of such Margin, to give the related Seller credit for such Margin in an amount equal to the market value thereof as determined in the sole good faith discretion of Administrative Agent against the Obligations and any other amounts owing by any Seller hereunder.  The proceeds of any disposition of Margin or any credit given for such Margin as contemplated herein shall be applied to such Obligations as determined by Administrative Agent in its sole discretion on behalf of each Buyer Entity, subject to the Administration Agreement. 
(b)    The remedies set forth herein are available to Administrative Agent and, as applicable, the other Buyer Entities in the Buyer Group, in any such case, for so long as an Event of Default under any Governing Agreement is continuing.  None of the rights and remedies of Administrative Agent or any other Buyer Entity shall be exclusive of any other available right or remedy, and each right and remedy shall be cumulative and in addition to any other right or remedy of Administrative Agent or such other Buyer Entity.  It is understood that a prior demand or call, or prior notice of the time and place of such sale or purchase, shall not be considered a waiver of the right of Administrative Agent to sell Margin without demand or notice.  Each Seller shall remain liable for any and all Obligations it owes to Administrative Agent and the other Buyer Entities in the Buyer Group remaining unpaid or unsatisfied after the application of Margin and the exercise 

6
2014057.06-NYCSR07A - MSW

of all rights hereunder.  The rights and remedies granted hereby to Administrative Agent and, as applicable, the other Buyer Entities in the Buyer Group are in addition to any rights and remedies under the Governing Agreements and any other DIP Warehouse Facility Agreement.  Without limiting the generality of the foregoing, as between the Sellers, on the one hand, and the Buyer Entities in the Buyer Group, on the other hand, nothing herein shall be construed as a requirement that Administrative Agent or any other Buyer Entity in the Buyer Group cause Margin held on account of a particular Obligation to be attributed (in whole or in part) to any other Obligation in determining whether or not Administrative Agent or other Buyer Entity is entitled to make a demand or call upon any Seller for additional securities, monies or other property under any such other Obligation to the extent such requirement does not otherwise expressly exist pursuant to the terms of the applicable Governing Agreement or any other DIP Warehouse Facility Agreement.  
Section 7.    Appointment as Attorney in Fact.  Each Seller hereby covenants that with respect to Margin and the delivery of Margin (a) it shall take such action as is reasonably necessary to cooperate with the Administrative Agent to perfect or preserve its security interest, legal or equitable charge or other mortgage or assignment in the Margin; and (b) on request, each Seller will ratify and confirm any deed, document, act and thing and all transactions that any such attorney-in-fact or agent may do which falls under the scope of this power of attorney.  Without limiting the foregoing and in addition to any rights granted to each Buyer Entity in the Buyer Group under the applicable Governing Agreements and any other applicable DIP Warehouse Facility Agreement, each Seller hereby appoints Administrative Agent as such Seller’s agent and attorney in fact to file any financing statements in such Seller’s name and to perform all other acts which any Buyer Entity in the Buyer Group deems appropriate in connection with the provisions of this Agreement.  This agency and power of attorney is coupled with an interest and is irrevocable without Administrative Agent’s consent on behalf of each Buyer Entity in the Buyer Group. 
Section 8.    Recoupment.  The rights of each Buyer Entity in the Buyer Group contained herein are in addition to any and all recoupment rights that each Buyer Entity may have at law or in equity against any Seller.
Section 9.    Assignment; Modification.  This Agreement may not be amended or modified except in a written instrument executed by each of the parties hereto.  The rights and obligations of the parties under this Agreement may not be assigned without the prior written consent of the other parties to this Agreement and any purported assignment without such consent shall be null and void; provided that, for so long as an Event of Default under any Governing Agreement is continuing, any Buyer Entity in the Buyer Group may assign its rights hereunder without the prior written consent of the Sellers; provided, further, that any permitted assignee of a Buyer Entity in the Buyer Group shall be subject to and in accordance with the Administration Agreement, and shall be a Buyer Entity hereunder.  Subject to the foregoing, this Agreement shall be binding on the parties and their successors and assigns and shall inure to the benefit of the Buyer Entities in the Buyer Group and their respective successors, endorsees, permitted transferees and permitted assigns, until all the Obligations shall have been satisfied by payment in full in cash, all the commitments under the Governing Agreements shall have terminated or expired and the Master Refinancing Agreement shall terminated in accordance with Article 11 thereof.

7
2014057.06-NYCSR07A - MSW

Section 10.    Representations, Warranties and Covenants.  Each Seller represents and warrants to Administrative Agent and each other Buyer Entity in the Buyer Group as follows as of the Effective Date and as of the date of any transaction under any MSFTA and each Purchase Date (as defined in each Repurchase Agreement) for any Transaction (as defined in each Repurchase Agreement) under any Repurchase Agreement:
(a)    it has all requisite power to execute, deliver and perform its obligations under this Agreement; 
(b)    subject to the entry of the DIP Orders with respect to Ditech and RMS, that this Agreement constitutes the legal, valid and binding obligation of such Seller, enforceable in accordance with its terms, subject (i) as to the enforcement of remedies, to applicable bankruptcy, insolvency and similar laws affecting creditors’ rights generally and (ii) to general principles of equity); 
(c)    it is entering into this Agreement at arm’s length and not in reliance on any inducement or information other than as set forth in this Agreement;
(d)    this Agreement creates a valid, fully perfected security interest in the Margin (having the priority described in the DIP Orders), free and clear of any adverse claims, subject in the case of lien perfection to the execution and delivery of any necessary control agreement(s), filing of applicable UCC financing statements or entry of the Interim DIP Order; 
(e)    the execution and delivery by such Seller and performance by such Seller of its obligations under this Agreement have been duly authorized by all necessary corporate action on the part of such Seller;
(f)    the execution and delivery by such Seller and performance by such Seller of its obligations under this Agreement do not and will not (i) subject to the entry of the DIP Orders with respect to Ditech and RMS, require any authorization, approval, consent, order, filing, or other action except such as has previously been obtained and is in full force and effect, (ii) violate, subject to the entry of the DIP Orders with respect to Ditech and RMS, any provision of applicable law, statue, rule or regulation or any order, writ, injunction or decree of any court or Governmental Authority (as defined in each Repurchase Agreement) applicable to such Seller, (iii) violate any provision of the organizational documents of such Seller, (iv) violate or result in a default under any provision of any indenture, material agreement, bond, note or other similar material instrument to which such Seller is a party or by which such Seller or any of its properties or assets are bound and that is either entered into after the Petition Date or with respect to which such Seller is obligated to comply during the pendency of its Case, (v) violate or result in a default under any provision of the RSA and (vi) result in the creation or imposition of any lien, charge or encumbrance of any nature whatsoever upon any properties or assets of such Seller (other than liens and security interests granted by such Seller pursuant this Agreement or any other DIP Warehouse Facility Agreement); and

8
2014057.06-NYCSR07A - MSW

(g)    such Seller will realize a direct economic benefit as a result of the transactions entered into from time to time by the Buyer Entities in the Buyer Group under the Governing Agreements.
Section 11.    Uniform Commercial Code Filings.  Prior to or concurrently with the execution of this Agreement, each Seller authorizes Administrative Agent to file such Uniform Commercial Code financing statements describing the Margin (or any portion thereof) as collateral, including any continuation statement or termination statement, or any amendment to any such financing statement, as Administrative Agent may require.
Section 12.    Intent; Interpretation and Headings.
(a)    Each Party intends that this Agreement constitutes a “netting contract” as defined in and subject to Title VI of the U.S. Federal Deposit Insurance Corporation Improvement Act of 1991 (“FDICIA”), and each payment entitlement and payment obligation hereunder and under the other Governing Agreements constitutes a “covered contractual payment entitlement” or “covered contractual payment obligation”, respectively, as defined in and subject to FDICIA.
(b)    Each Party intends that each payment to be made under this Agreement (including payments by way of setoff or application of collateral) is a “termination value,” “payment amount” or “other transfer obligation” within the meaning of sections 362 and 561 of Title 11 of the Bankruptcy Code and a “margin payment,” “settlement payment” or “transfer” within the meaning of section 546 of the Bankruptcy Code.
(c)    Each Party intends that this Agreement constitutes and shall be construed and interpreted as a “master netting agreement” within the meaning of and as such terms are used in Section 561 of the Bankruptcy Code.
(d)    Each Party agrees that this Agreement is intended to create mutuality of obligations among the Parties, and as such, this Agreement constitutes a contract which (i) is between all of the Parties and (ii) places each Party in the same right and capacity.
(e)    The use of headings and subheadings in this Agreement, and the division of this Agreement into sections and sub sections, are for convenience of reference only and shall not affect the interpretation or construction of this Agreement.
Section 13.    Amendment and Ratification of Governing Agreements; Severability.
(a)    Each Party agrees that each Governing Agreement is hereby amended to the extent necessary to give effect to this Agreement, including, without limitation, by the deletion of any automatic termination provisions set forth in any of the Governing Agreements and the replacement of each such automatic termination provision with a right of each Buyer Entity in the Buyer Group to terminate such Governing Agreement upon the occurrence of the events giving rise to such automatic termination and by the addition of the address, facsimile number or electronic 

9
2014057.06-NYCSR07A - MSW

mail system details at which notices or other communications are to be given under such Governing Agreement of the information set forth herein.
(b)    Each Party agrees that if any Governing Agreement does not provide that all transactions under a Governing Agreement are entered into in reliance on the fact that such Governing Agreement and all transactions thereunder form a single agreement, then such Governing Agreement is hereby amended to include such a provision as a statement of the parties’ intent.
(c)    The Governing Agreements, as amended by this Agreement, are in all respects ratified and confirmed.
(d)    The Parties intend that this Agreement be construed to give full effect to the intent of the Parties with respect to the Margin, netting and setoff contemplated herein.  In the event any one or more of the provisions contained in this Agreement should be held invalid, illegal, or unenforceable in any respect under the law of any jurisdiction, then (i) the validity, legality, and enforceability of the remaining provisions under the law of such jurisdiction, and the validity, legality, and enforceability of such provisions and any other provisions under the law of any other jurisdiction, shall not in any way be affected, invalidated or impaired thereby and (ii) the Parties shall endeavor in good faith negotiations to replace the invalid, illegal, or unenforceable provisions or obligations with valid provisions the economic effect of which comes as close as possible to that of the invalid, illegal, or unenforceable provisions or obligation. 
(e)    In the event that this Agreement is deemed or held to be invalid, illegal, or unenforceable, notwithstanding the intention of the Parties set forth in Section 13(d), the provisions of this Agreement that amend the Governing Agreements to (i) amend any automatic termination provisions as contemplated by Section 13(a), (ii) provide that all transactions under a Governing Agreement are entered into in reliance on the fact that such Governing Agreement and all transactions thereunder form a single agreement as contemplated by Section 13(b), and (iii) change the notice information in each Governing Agreement as contemplated by Section 13(a) shall survive any determination that this Agreement is invalid, illegal, unenforceable, null and void, or without force or effect.
Section 14.    Recordings of Communications.  Each Buyer Entity in the Buyer Group shall have the right (but not the obligation) from time to time to make or cause to be made tape recordings of communications between its employees and those of any Seller with respect to Obligations.  Each Seller consents to the admissibility of such tape recordings in any court, arbitration or other proceedings.  Each Seller agrees that a duly authenticated transcript of such a tape recording shall be deemed to be a writing conclusively evidencing the Parties’ agreement.
Section 15.    Enforcement Costs and Expenses.  The Sellers shall reimburse the Buyer Group for any damages, claims, liabilities, reasonable expenses (including reasonable attorney’s fees), arising out of the enforcement of this Agreement or any other Governing Agreement.
Section 16.    No Future Obligations.  Notwithstanding anything contained in this Agreement and except only as may be expressly set forth in the Governing Agreements, none of the Parties to this Agreement shall be obligated to enter into any future Obligations, except as 

10
2014057.06-NYCSR07A - MSW

required under an applicable Governing Agreement.  Each Party agrees that it will deliver such documents and take such action as are reasonably required to implement the terms of this Agreement.
Section 17.    GOVERNING LAW.  THIS AGREEMENT SHALL BE GOVERNED BY, AND CONSTRUED IN ACCORDANCE WITH, THE LAWS OF THE STATE OF NEW YORK, WITHOUT REFERENCE TO THE CHOICE OF LAW PROVISIONS THEREOF (OTHER THAN SECTION 5-1401 OF THE NEW YORK GENERAL OBLIGATIONS LAW) AND, TO THE EXTENT APPLICABLE, THE BANKRUPTCY CODE.
Section 18.    WAIVER OF JURY TRIAL.  EACH PARTY HERETO HEREBY WAIVES, TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW, ANY RIGHT IT MAY HAVE TO A TRIAL BY JURY IN RESPECT OF ANY LITIGATION DIRECTLY OR INDIRECTLY ARISING OUT OF, UNDER OR IN CONNECTION WITH THIS AGREEMENT (WHETHER BASED ON CONTRACT, TORT OR ANY OTHER THEORY). EACH PARTY HERETO (I) CERTIFIES THAT NO REPRESENTATIVE, AGENT OR ATTORNEY OF ANY OTHER PARTY HAS REPRESENTED, EXPRESSLY OR OTHERWISE, THAT SUCH OTHER PARTY WOULD NOT, IN THE EVENT OF LITIGATION, SEEK TO ENFORCE THE FOREGOING WAIVER AND (II) ACKNOWLEDGES THAT IT AND THE OTHER PARTIES HERETO HAVE BEEN INDUCED TO ENTER INTO THIS AGREEMENT BY, AMONG OTHER THINGS, THE MUTUAL WAIVERS AND CERTIFICATIONS IN THIS PARAGRAPH. 
Section 19.    SUBMISSION TO JURISDICTION.  EACH PARTY HERETO IRREVOCABLY AND UNCONDITIONALLY AGREES THAT IT WILL NOT COMMENCE ANY ACTION, LITIGATION OR PROCEEDING OF ANY KIND OR DESCRIPTION, WHETHER IN LAW OR EQUITY, WHETHER IN CONTRACT OR TORT OR OTHERWISE, AGAINST THE ADMINISTRATIVE AGENT, ANY BUYER ENTITY IN THE BUYER GROUP OR ANY RELATED PARTY OF ANY OF THE FOREGOING, IN ANY WAY RELATING TO THIS AGREEMENT OR THE TRANSACTIONS RELATING HERETO, IN A FORUM OTHER THAN THE BANKRUPTCY COURT (OR, IF THE BANKRUPTCY COURT DOES NOT HAVE (OR ABSTAINS FROM) JURISDICTION, THE COURTS OF THE STATE OF NEW YORK SITTING IN NEW YORK COUNTY, AND OF THE UNITED STATES DISTRICT COURT OF THE SOUTHERN DISTRICT OF NEW YORK, AND ANY APPELLATE COURT FROM ANY THEREOF, AND EACH OF THE PARTIES HERETO IRREVOCABLY AND UNCONDITIONALLY SUBMITS TO THE JURISDICTION OF SUCH COURTS AND AGREES THAT ALL CLAIMS IN RESPECT OF ANY SUCH ACTION, LITIGATION OR PROCEEDING MAY BE HEARD AND DETERMINED IN SUCH NEW YORK STATE COURT OR, TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW, IN THE BANKRUPTCY COURT OR SUCH OTHER FEDERAL COURT.  EACH OF THE PARTIES HERETO AGREES THAT A FINAL JUDGMENT IN ANY SUCH ACTION, LITIGATION OR PROCEEDING SHALL BE CONCLUSIVE AND MAY BE ENFORCED IN OTHER JURISDICTIONS BY SUIT ON THE JUDGMENT OR IN ANY OTHER MANNER PROVIDED BY LAW.  NOTHING IN THIS AGREEMENT, ANY GOVERNING 

11
2014057.06-NYCSR07A - MSW

AGREEMENT OR IN ANY OTHER RELATED AGREEMENT SHALL AFFECT ANY RIGHT THAT THE ADMINISTRATIVE AGENT MAY OTHERWISE HAVE TO BRING ANY ACTION OR PROCEEDING RELATING TO THIS AGREEMENT, ANY GOVERNING AGREEMENT OR IN ANY OTHER RELATED AGREEMENT AGAINST ANY SELLER, ANY AFFILIATE THEREOF OR ANY OF THEIR RESPECTIVE PROPERTIES IN THE COURTS OF ANY JURISDICTION.  Each of the parties hereto hereby irrevocably and unconditionally waives, to the fullest extent it may legally and effectively do so, any objection which it may now or hereafter have to the laying of venue of any suit, action or proceeding arising out of or relating to this Agreement in the Bankruptcy Court or any such New York State or federal court referred to above. Each of the parties hereto hereby irrevocably waives, to the fullest extent permitted by law, the defense of an inconvenient forum to the maintenance of such action or proceeding in any such court.
Section 20.    Counterparts.  This Agreement may be executed in any number of counterparts, all of which taken together shall constitute one and the same instrument, and any of the parties hereto may execute this Agreement by signing any such counterpart.  Counterparts may be delivered electronically.
Section 21.    Conflict and Savings Clause.  In the event that a DIP Warehouse Facility Agreement or an account agreement that is also subject to this Agreement prohibits a Seller from granting a security interest in Margin under this Agreement or prohibits a Seller from providing a right of setoff under this Agreement, then this Agreement shall be deemed to control over such other DIP Warehouse Facility Agreement or account agreement for purposes of preserving the rights of each Buyer Entity in the Buyer Group hereunder.
Section 22.    Bankruptcy Non-Petition.  The parties hereby agree that they shall not institute against, or join any other person in instituting against, any Buyer Entity in the Buyer Group that is a CP Conduit any bankruptcy, reorganization, arrangement, insolvency or liquidation proceeding, or other proceeding under any federal or state bankruptcy or similar law, for one year and one day after the latest maturing commercial paper note issued by the applicable CP Conduit is paid in full.
Section 23.    Limited Recourse.  The obligations of each party under this Agreement or any other Governing Agreement are solely the corporate or limited liability company obligations of such party. No recourse shall be had for the payment of any amount owing by any party under this Agreement, or for the payment by any party of any fee in respect hereof or any other obligation or claim of or against such party arising out of or based on this Agreement, against any stockholder, partner, member, employee, officer, director or incorporator or other authorized person of such party. In addition, notwithstanding any other provision of this Agreement, the parties agree that all payment obligations of any Buyer Entity in the Buyer Group that is a CP Conduit under this Agreement shall be limited recourse obligations of such CP Conduit, payable solely from the funds of such CP Conduit available for such purpose in accordance with its commercial paper program documents. Each party waives payment of any amount which such CP Conduit does not pay pursuant to the operation of the preceding sentence until the day which is at least one year and one day after the payment in full of the latest maturing commercial paper note (and waives any 

12
2014057.06-NYCSR07A - MSW

“claim” against such CP Conduit within the meaning of Section 101(5) of the Bankruptcy Code or any other debtor relief law for any such insufficiency until such date).
[SIGNATURE PAGE FOLLOWS]

13
2014057.06-NYCSR07A - MSW

IN WITNESS WHEREOF, the undersigned have executed this Margin, Setoff and Netting Agreement as of the date first written above.

BARCLAYS BANK PLC,  
as Administrative Agent
By    /s/ Joseph O’ Doherty            
Name: Joseph O’ Doherty
Title:  Managing Director

BARCLAYS BANK PLC,  
as a Buyer 

By    /s/ Joseph O’ Doherty            
Name: Joseph O’ Doherty
Title:   Managing Director

BARCLAYS CAPITAL INC.,  
as an MSFTA Counterparty

By    /s/ Joseph O’ Doherty            
Name: Joseph O’ Doherty
Title:  Managing Director

Signature Page to the Margin, Setoff and Netting Agreement

NOMURA CORPORATE FUNDING AMERICAS, LLC, as a Buyer 

By    /s/ Vincent Primiano                
Name: Vincent Primiano
Title:   Managing Director

NOMURA SECURITIES INTERNATIONAL, INC., as an MSFTA Counterparty

By    /s/ Vincent Primiano                
Name: Vincent Primiano
Title:   Managing Director

Signature Page to the Margin, Setoff and Netting Agreement

DITECH FINANCIAL LLC,  
as a Seller
By    /s/ Joanna Colaneri                
Name: Joanna Colaneri
Title:   Senior Vice President and Treasurer

REVERSE MORTGAGE SOLUTIONS, INC.,  
as a Seller

By    /s/ Andrew Dokos                
Name: Andrew Dokos
Title:   Vice President and Treasurer

RMS REO BRC II, LLC, as a Seller

By    /s/ Andrew Dokos                
Name: Andrew Dokos
Title:   Vice President and Treasurer

Signature Page to the Margin, Setoff and Netting Agreement

ACKNOWLEDGED AND AGREED:

DITECH HOLDING CORPORATION,  
as Guarantor

By    /s/ Joanna Colaneri                
Name: Joanna Colaneri
Title:   Senior Vice President and Treasurer

Signature Page to the Margin, Setoff and Netting AgreementExhibit

EXHIBIT 10.40

MASTER REFINANCING AGREEMENT
BARCLAYS BANK PLC, as administrative agent for the Buyers and other Secured Parties  
(in such capacity, “Administrative Agent”),
BARCLAYS BANK PLC and NOMURA CORPORATE FUNDING AMERICAS, LLC,  
each as Buyer and other Buyers from time to time (“Buyers”),
BARCLAYS CAPITAL INC. and NOMURA SECURITIES INTERNATIONAL, INC.,  
each as an MSFTA Counterparty (“MSFTA Counterparties”),
DITECH FINANCIAL LLC, as a DIP Seller (“Ditech”),
REVERSE MORTGAGE SOLUTIONS, INC., as a DIP Seller (“RMS”), 
RMS REO BRC II, LLC, as a DIP Seller (“REO Subsidiary”), 
and
DITECH HOLDING CORPORATION, as guarantor (“Guarantor”)
Dated as of February 14, 2019

 

2014058.10-NYCSR07A - MSW

TABLE OF CONTENTS
Page

ARTICLE 1: DEFINITIONS................................................................................................2
ARTICLE 2: CONDITIONS PRECEDENT TO  EFFECTIVE DATE AND INITIAL FUNDINGS...........................................................................................................15
ARTICLE 3: [RESERVED]................................................................................................17
ARTICLE 4: CERTAIN COVENANTS.............................................................................17
ARTICLE 5: EVENTS OF DEFAULT................................................................................19
ARTICLE 6: REMEDIES...................................................................................................24
ARTICLE 7: FEES AND EXPENSES...............................................................................25
ARTICLE 8: MILESTONES..............................................................................................26
ARTICLE 9: REPORTING................................................................................................27
A. Cash Flow Forecasts..........................................................................................27
B. Other Reporting..................................................................................................27
ARTICLE 10: CONFLICTS...............................................................................................27
ARTICLE 11: MISCELLANEOUS...................................................................................28

SCHEDULES AND EXHIBITS:

Schedule I:    Certain Closing Documents
Schedule II:    Specified Existing Program Agreements
Exhibit A:     Prepetition Warehouse Facility Agreements
Exhibit B:     Interim DIP Order
Exhibit C:     Form of Officer’s Compliance Certificate

i
2014058.10-NYCSR07A - MSW

This MASTER REFINANCING AGREEMENT, dated as of February 14, 2019 (as amended, restated, supplemented or otherwise modified from time to time, this “Master Refinancing Agreement”), is entered into by and among BARCLAYS BANK PLC (“Barclays”), as administrative agent for the Buyers and other Secured Parties (as defined below) (including the “Buyers” party hereto) (in such capacity, “Administrative Agent”), BARCLAYS, as a Buyer (as defined below), NOMURA CORPORATE FUNDING AMERICAS, LLC (“Nomura”), as a Buyer, BARCLAYS CAPITAL INC. (“Barclays Capital”), as an MSFTA Counterparty (as defined below), NOMURA SECURITIES INTERNATIONAL, INC. (“Nomura Securities”), as an MSFTA Counterparty, DITECH FINANCIAL LLC (“Ditech”), REVERSE MORTGAGE SOLUTIONS, INC. (“RMS” and, together with Ditech, the “Sellers”), RMS REO BRC II, LLC (the “REO Subsidiary” and together with the Sellers, the “DIP Sellers”), and DITECH HOLDING CORPORATION (“Guarantor”).
Recitals
WHEREAS, on February 11, 2019, the Guarantor, Ditech, RMS and certain of their Affiliates filed the Cases (defined below) in the Bankruptcy Court (defined below);
WHEREAS, in connection with the Cases, the Sellers and certain of their Affiliates propose to refinance and replace in full the facilities contained in the Prepetition Warehouse Facility Agreements (as defined below);
WHEREAS, concurrently with the effectiveness of this Master Refinancing Agreement, the Administrative Agent, Buyers, and Ditech are entering into that certain Master Repurchase Agreement, dated as of the Effective Date (as amended, restated, supplemented or otherwise modified from time to time, the “Ditech Repurchase Agreement”);
WHEREAS, concurrently with the effectiveness of this Master Refinancing Agreement, the Administrative Agent, Buyers, RMS, and the REO Subsidiary are entering into that certain Amended and Restated Master Repurchase Agreement, dated as of the Effective Date (as amended, restated, supplemented or otherwise modified from time to time, the “RMS Repurchase Agreement”);
WHEREAS, Ditech Agency Advance Trust, as issuer (“SAF Agency Issuer”), Wells Fargo Bank, N.A. (“Wells Fargo”), as indenture trustee, calculation agent, paying agent and securities intermediary (in such capacities, the “SAF Agency Indenture Trustee”), Ditech, and Credit Suisse First Boston Mortgage Capital LLC, as administrative agent (in such capacity, the “Prior SAF Agency Agent”), previously entered into that certain Indenture, dated as of February 9, 2018, and effective as of February 12, 2018 (as amended, restated, supplemented or otherwise modified from time to time, including, but not limited to, by the SAF Agency Indenture Supplement (as defined below), the “SAF Agency Indenture”);
WHEREAS, concurrently with the effectiveness of this Master Refinancing Agreement, SAF Agency Issuer, SAF Agency Indenture Trustee, Ditech, Barclays, as administrative agent (in such capacity, the “DIP SAF Agency Agent”), and Barclays, as an SAF Agency Noteholder (as defined below), are entering into that certain Series 2019-VF1 Indenture Supplement, dated as 

1
2014058.10-NYCSR07A - MSW

of the Effective Date (as amended, restated, supplemented or otherwise modified from time to time, the “SAF Agency Indenture Supplement”);
WHEREAS, Ditech PLS Advance Trust II, as issuer (“SAF PLS Issuer” and together with the SAF Agency Issuer, the “SAF SPVs”), Wells Fargo, as indenture trustee, calculation agent, paying agent and securities intermediary (in such capacities, the “SAF PLS Indenture Trustee”), Ditech, and Credit Suisse First Boston Mortgage Capital LLC, as administrative agent (in such capacity, the “Prior SAF PLS Agent”), previously entered into that certain Indenture, dated as of February 9, 2018, and effective as of February 12, 2018 (as amended, restated, supplemented or otherwise modified from time to time, including, but not limited to, by the SAF PLS Indenture Supplement (as defined below), the “SAF PLS Indenture” and, together with the SAF Agency Indenture, the “Indentures”);
WHEREAS, concurrently with the effectiveness of this Master Refinancing Agreement, SAF PLS Issuer, SAF PLS Indenture Trustee, Ditech, Barclays, as administrative agent (in such capacity, the “DIP SAF PLS Agent”), and Barclays, as an SAF PLS Noteholder (as defined below), are entering into that certain Series 2019-VF1 Indenture Supplement, dated as of the Effective Date (as amended, restated, supplemented or otherwise modified from time to time, the “SAF PLS Indenture Supplement”);
WHEREAS, pursuant to each Repurchase Agreement, the Buyers party thereto from time to time shall agree to enter into Transactions (as defined in such Repurchase Agreement) for the purchase of mortgage loans or other assets as described therein (collectively, the “Purchased Assets”) from the DIP Sellers party thereto, subject to the applicable DIP Sellers’ obligation to repurchase such Purchased Assets at the Repurchase Price (as defined in such Repurchase Agreement) on or prior to the Repurchase Date (as defined in such Repurchase Agreement);
WHEREAS, pursuant to each Indenture, the Buyers party thereto from time to time shall agree to fund certain VFN Draws (as defined in such Indenture) to the SAF SPV party thereto (collectively, the “VFN Draws”), which VFN Draws are secured by certain Receivables (as defined in such Indenture) and are evidenced by one or more variable funding promissory notes, subject to such SAF SPV’s obligation to repay such VFN Draws on or prior to the Expected Repayment Date (as defined in such Indenture); and
WHEREAS, the parties hereto desire to enter into this Master Refinancing Agreement in order to set out certain provisions regarding, inter alia, (i) certain common conditions precedent to the occurrence of the Effective Date and each Funding Date, (ii) certain common covenants of the Guarantor, the DIP Sellers and certain of their Affiliates, and (iii) certain common Events of Default, in each case, under the Governing Agreements, as applicable.
NOW, THEREFORE, in consideration of the mutual covenants contained herein and for other good and valuable consideration, the parties hereto, intending to be legally bound, hereby agree as follows:

2
2014058.10-NYCSR07A - MSW

ARTICLE 1:DEFINITIONS
A.    Capitalized terms used but not otherwise defined herein shall have the meanings given to them in the Repurchase Agreements, the Master DIP Fee Letter, the Indentures and DIP Guaranty, as applicable, unless otherwise indicated or amended or supplemented hereby.
B.    All references to “Program Agreements” and “Program Documents” herein and in each Repurchase Agreement shall be deemed to include this Master Refinancing Agreement, the Netting Agreement, the Master DIP Fee Letter, the DIP Guaranty and the Administration Agreement. 
C.    Whenever used in this Master Refinancing Agreement, the following words and phrases, unless context otherwise requires, shall have the following meanings:
“Acceptable Plan” shall mean a chapter 11 plan of reorganization in the Cases that (a) provides for the termination of the commitments of the Secured Parties under the DIP Warehouse Facility Agreements on the effective date of such plan, (b) provides for the payment in full in cash of all obligations of the Guarantor, the DIP Sellers, the SAF SPVs and the Depositors with respect to the DIP Warehouse Facility Agreements on the effective date of such plan, (c) contains release, indemnification and exculpatory provisions relating to the Secured Parties that are satisfactory to the Administrative Agent (with the consent of the Required Buyers in their sole discretion), (d) is otherwise in form and substance reasonably satisfactory to the Buyers, and (e) contemplates effectiveness of such plan no later than the Stated Termination Date.
“Acceptable Sale Agreement” shall mean an initial Sale Agreement or replacement Sale Agreement, as the case may be, that satisfies each of the requirements listed below and shall otherwise, in form and substance, be acceptable to Buyers in their reasonable discretion:
(a)    The agreement shall be in form and substance reasonably satisfactory to Administrative Agent (at the direction of Required Buyers).
(b)    Without limiting the generality of clause (a) above, the agreement shall not be subject to any diligence or financing conditions and the proposed purchaser(s) shall have obtained all requisite corporate/organizational approvals, and has obtained, or is reasonably likely to obtain all necessary governmental and third-party consents, within a time frame such that the contemplated sale is capable of being consummated in accordance with the Chapter 11 Milestones prior to the Stated Termination Date. 
(c)    The proposed purchaser(s) is/are capable of consummating the sale in accordance with the Chapter 11 Milestones prior to the Stated Termination Date, after taking into account all relevant legal, regulatory, and business considerations.
(d)    The proposed purchaser(s) shall have provided such financial and other information demonstrating the proposed purchaser’s or purchasers’ financial wherewithal and business capabilities to fulfill all obligations in connection with the transactions 

3
2014058.10-NYCSR07A - MSW

contemplated by the agreement, including, without limitation, any equity or debt financing commitment letters.
(e)    The agreement shall provide for (i) the termination of the commitments of the Secured Parties under the DIP Warehouse Facility Agreements and (ii) net cash proceeds in an aggregate amount sufficient for the payment in full in cash of all obligations of the Guarantor, the DIP Sellers, the SAF SPVs and the Depositors with respect to the DIP Warehouse Facility Agreements, the DIP Guaranty and this Master Refinancing Agreement, in each case, after giving effect to the closing(s) of the sale(s) contemplated thereby in accordance with the terms of such agreement(s).
“Act of Insolvency” shall mean, with respect to any Person, (a) the filing of a petition, commencing, or authorizing the commencement of any case or proceeding, or the voluntary joining of any case or proceeding under any bankruptcy, insolvency, reorganization, liquidation, dissolution or similar law relating to the protection of creditors, or suffering any such petition or proceeding to be commenced by another which is consented to, not timely contested or results in entry of an order for relief; (b) the seeking of the appointment of a receiver, trustee, custodian or similar official for such party or any substantial part of the property of either; (c) the appointment of a receiver, conservator, or manager for such party by any governmental agency or authority having the jurisdiction to do so; (d) the making or offering by such party of a composition with its creditors or a general assignment for the benefit of creditors; (e) the admission by such party of its inability to pay its debts or discharge its obligations as they become due or mature; or (f) that any governmental authority or agency or any person, agency, or entity acting or purporting to act under governmental authority shall have taken any action to condemn, seize or appropriate, or to assume custody or control of, all or any substantial part of the property of such party, or shall have taken any action to displace the management of such party or to curtail its authority in the conduct of the business of such party.
“Adjusted Tangible Net Worth” means, with respect to any Seller, the Net Worth of such Seller on a consolidated basis minus (a) all intangible assets determined in accordance with GAAP (including goodwill and excluding originated and purchased mortgage servicing rights of such Seller) and (b) any and all advances to, investments in and receivables from Affiliates of Seller (in the case of RMS, other than with respect to RMS and Subsidiaries of RMS).
“Administration Agreement” shall mean that certain Master Administration Agreement, dated as of the Effective Date, by and among (i) the Administrative Agent, (ii) the Buyers party thereto from time to time, (iii) the MSFTA Counterparties, and (iv) the DIP Sellers, as it may be amended, restated, supplemented or otherwise modified from time to time. 
“Administrative Agent” shall have the meaning assigned to such term in the Preamble.
“Agency” shall mean any of Fannie Mae, Freddie Mac, Ginnie Mae, HUD, or the FHA or any person, agency or entity acting or purporting to act under governmental authority on behalf of any of the foregoing.

4
2014058.10-NYCSR07A - MSW

“Bankruptcy Code” shall mean title 11 of the United States Code, 11 U.S.C. § 101, et seq., as amended from time to time.
“Bankruptcy Court” shall mean the United States Bankruptcy Court for the Southern District of New York having jurisdiction over the Cases or any other court having jurisdiction over the Cases, including, to the extent of the withdrawal of any reference under 28 U.S.C. § 157, the United States District Court for the Southern District of New York. 
“Barclays” shall have the meaning assigned to such term in the Preamble.
“Barclays Capital” shall have the meaning assigned to such term in the Preamble.
“Barclays MSFTA” shall mean that certain Master Securities Forward Transaction Agreement, dated as of May 18, 2017, between Barclays Capital, and Ditech, as amended by that certain Amendment dated as of June 15, 2017, as further amended, restated, supplemented or otherwise modified from time to time.
“Business Day” shall mean any day other than (i) a Saturday or Sunday; (ii) a day on which the New York Stock Exchange or the Federal Reserve Bank of New York is authorized or obligated by law or executive order to be closed or (iii) a public or bank holiday in New York City.
“Buyers” shall mean collectively, (a) with respect to any Repurchase Agreement, Barclays, Nomura and their respective successors in interest and permitted assigns, as “Buyers” or “Purchasers”, as the case may be, under such Repurchase Agreement, (b) with respect to the SAF Agency Indenture, the SAF Agency Noteholders, and (c) with respect to the SAF PLS Indenture, the SAF PLS Noteholders.
“Carve-Out” shall have the meaning assigned to such term in the DIP Orders.
“Cases” shall mean the cases under chapter 11 of the Bankruptcy Code commenced by the Guarantor, Ditech, RMS and the other Debtors in the Bankruptcy Court and styled as In re Ditech Holding Corporation, et al., Case No. 19-10412. 
“Change in Control” shall mean:
(a)     any transaction or event as a result of which Guarantor ceases to own, directly or indirectly, 100% of the stock of each Seller;
(b)     the sale, transfer, or other disposition of all or substantially all of Seller’s assets (excluding any such action taken in connection with any securitization transaction or routine sales of mortgage loans or routine sales of mortgage servicing rights); or
(c)    the consummation of a merger or consolidation of Guarantor with or into another entity or any other corporate reorganization, if more than 50% of the combined voting power of the continuing or surviving entity’s equity outstanding immediately after such merger, consolidation or such other reorganization is owned by persons who were not equityholders of the Guarantor immediately prior to such merger, consolidation or other reorganization

5
2014058.10-NYCSR07A - MSW

“Chapter 11 Milestones” shall have the meaning assigned to such term in Article 8.
“Collateral” shall mean, collectively, (a) the “Repurchase Assets”, the “Purchased Assets” and the “Purchased Items”, as defined in the related Repurchase Agreement, (b) the collateral under the Netting Agreement, (c) all “Collateral” as defined in each Indenture, (d) all “DIP Collateral” as defined in the DIP Orders and (e) all other assets of any DIP Seller, Depositor, SAF SPV or any of their respective Affiliates subject to a Lien securing all or any portion of the Secured Obligations.
“Commitment Letter” shall mean that certain commitment letter, dated February 8, 2019, among the Guarantor, Ditech, RMS, Barclays and Nomura.
“CP Conduit” shall mean a commercial paper conduit administered, managed or supported by any Buyer or by a Person who, directly or indirectly is in control of, or is controlled by, or is under common control with any Buyer.
“Debtor Relief Law” shall mean any law, administration, or regulation relating to reorganization, winding up, administration, composition or adjustment of debts or otherwise relating to bankruptcy or insolvency.
“Debtors” shall mean, collectively, the Guarantor; Ditech; RMS; DF Insurance Agency LLC; Green Tree Credit LLC; Green Tree Credit Solutions LLC; Green Tree Insurance Agency of Nevada, Inc.; Green Tree Investment Holdings III LLC; Green Tree Servicing Corp.; Marix Servicing LLC; Mortgage Asset Systems, LLC; REO Management Solutions, LLC; Walter Management Holding Company LLC; and Walter Reverse Acquisition  LLC.  The Debtors shall not include the REO Subsidiary, any Depositor, or any SAF SPV.
“Default” shall mean an Event of Default or an event that with notice or lapse of time or both would become an Event of Default.
“Default Rate” shall mean (a) with respect to the Ditech Repurchase Agreement, “Post Default Rate” as defined therein, (b) with respect to the RMS Repurchase Agreement, “Default Rate” as defined therein, and (c) with respect to any other Repurchase Agreement “Post Default Rate” or “Default Rate”, as the case may be, as defined in such Repurchase Agreement.
“Depositor Equity Pledge Agreement” shall mean that certain Depositor Equity Pledge Agreement, dated as of the Effective Date, by Ditech in favor of the Administrative Agent, and acknowledged and agreed to by the Depositors.
“Depositors” shall mean, collectively, the SAF Agency Depositor and the SAF PLS Depositor.
“Designated MSFTA” shall mean any Master Securities Forward Transaction Agreement, by and between (i) Ditech and (ii) a Person who becomes a Buyer under the Ditech Repurchase Agreement pursuant to an assignment in accordance with Article 5 of the Administration Agreement, or an Affiliate of such a Buyer, as amended, restated, supplemented or otherwise modified from time to time; provided that, in connection with such assignment, (x) Ditech shall have delivered to 

6
2014058.10-NYCSR07A - MSW

the Administrative Agent and the other Buyers party to the Ditech Repurchase Agreement a written request to designate such Master Securities Forward Transaction Agreement as a “Designated MSFTA” for purposes of this Master Refinancing Agreement, and (y) the Administrative Agent and the Buyers contemplated to continue being parties to the Ditech Repurchase Agreement immediately after giving effect to such assignment shall have consented to such designation.
“DIP Guaranty” shall mean that certain Master DIP Guaranty, dated as of the Effective Date, by Guarantor in favor of Administrative Agent, for the benefit of the Buyer Parties (as defined therein), as amended, restated, supplemented or otherwise modified from time to time.
“DIP HMBS Repurchase Agreement” shall mean any repurchase agreement for Ginnie Mae Tail HMBS (as defined in the RMS Repurchase Agreement) that is entered into after the Effective Date as contemplated by Article 11.E.2 hereof, between (i) RMS and (ii) a Person who is a Buyer under the RMS Repurchase Agreement, or an Affiliate of such a Buyer, as amended, restated, supplemented or otherwise modified from time to time; provided that, prior to the effectiveness thereof, (x) RMS shall have delivered to the Administrative Agent and the other Buyers party to the RMS Repurchase Agreement a written request to designate such repurchase agreement as a “DIP HMBS Repurchase Agreement” for purposes of this Master Refinancing Agreement, and (y) the Administrative Agent and such Buyers shall have consented to such designation.
“DIP Maturity Date Event of Default” shall mean a failure to do each of the following on or before the earliest to occur of the dates referred to in clauses (a), (c) and (d) of the definition of Termination Date: (i) pay the Secured Obligations in full in cash, (ii) reduce the Maximum Available Funding for each Governing Agreement and the Maximum Combined Purchase Price to zero and (iii) terminate any other commitment of any Secured Party to extend credit under, or enter into transactions pursuant to, any of the DIP Warehouse Facility Agreements.
“DIP Orders” shall mean the Interim DIP Order and the Final DIP Order related to the Cases.  
“DIP SAF Agency Agent” shall have the meaning assigned to such term in the Recitals.
“DIP SAF PLS Agent” shall have the meaning assigned to such term in the Recitals.
“DIP Sellers” shall have the meaning assigned to such term in the Preamble.
“DIP Superpriority Claims” shall have the meaning assigned to such term in the DIP Orders.
“DIP Warehouse Facility Agreements” shall mean, collectively, (a) the DIP Orders, (b) this Master Refinancing Agreement, (c) the DIP Guaranty, (d) the Netting Agreement, (e) the Administration Agreement, (f) the MSFTAs, (g) the Ditech Repurchase Agreement and the related Program Agreements, (h) the RMS Repurchase Agreement and the related Program Agreements, (i) any other Repurchase Agreement and the related Program Agreements, (j) the SAF Agency Indenture and the related Program Agreements, (k) the Master DIP Fee Letter, (l) SAF PLS Indenture and the related Program Agreements and (m) the Depositor Equity Pledge Agreement.
“Ditech” shall have the meaning assigned to such term in the Preamble.

7
2014058.10-NYCSR07A - MSW

“Ditech/Fannie Agreement” shall mean the Mortgage Selling and Servicing Contract with Fannie Mae and the Fannie Mae Selling Guide, together with all supplements, addenda and amendments thereto and incorporating all of the applicable guides. 
“Ditech/Freddie Agreement” shall mean that certain Master Agreement with Freddie Mac and the Freddie Mac Single Family Seller/Servicing Guide, together with all supplements, addenda and amendments thereto and incorporating all of the applicable guides, described in more detail on Schedule 1 to the SAF Agency Indenture (as such schedule may be updated from time to time pursuant to the SAF Agency Indenture).
“Ditech/Ginnie Agreement” shall mean those certain Guaranty Agreements and Master Servicing Agreement between Ditech and Ginnie Mae, together with all supplements, addenda and amendments thereto and incorporating all the applicable guides.
“Ditech Repurchase Agreement” shall have the meaning assigned to such term in the Recitals.
“Dollars”, “U.S. Dollars” and “$” means dollars in lawful currency of the United States of America.
“Effective Date” shall mean the first Business Day on which each of the conditions precedent set forth in Article 2 shall have been satisfied or waived by the Administrative Agent (at the direction of Required Buyers in their sole discretion).
“Event of Default” shall have the meaning assigned to such term in the Article 5.
“FHA” means the Federal Housing Administration, an agency within HUD, or any successor thereto, and including the Federal Housing Commissioner and the Secretary of Housing and Urban Development where appropriate under the FHA regulations.
“Final Cash Management Order” shall mean a final order entered by the Bankruptcy Court related to the Cases, in form and substance satisfactory to Administrative Agent and the Buyers, authorizing, inter alia, Ditech to continue using existing cash management system, bank accounts and business forms and implementing changes to the cash management system.
“Final DIP Order” shall mean a final financing and cash collateral order entered by the Bankruptcy Court related to the Cases, and in form and substance satisfactory to the Administrative Agent and the Buyers. 
“Final Ditech OCB Order” shall mean a final order entered by the Bankruptcy Court related to Ditech’s Case, in form and substance satisfactory to Administrative Agent and the Buyers, authorizing, inter alia, Ditech to continue in the ordinary course to perform its obligations under (x) the Ditech/Fannie Agreement, (y) the Ditech/Freddie Agreement, and (z) the Ditech/Ginnie Agreement.
“Final OCB Orders” shall mean, collectively, the Final Ditech OCB Order and the Final RMS OCB Order.

8
2014058.10-NYCSR07A - MSW

“Final RMS OCB Order” shall mean a final order entered by the Bankruptcy Court related to RMS’ Case, in form and substance satisfactory to Administrative Agent and the Buyers, authorizing, inter alia, RMS to perform under all RMS/Ginnie/HUD Agreements.
“First Lien Term Loan Collateral” shall have the meaning assigned to such term in the DIP Orders.
“First Lien Term Loan Obligations” shall have the meaning assigned to such term in the DIP Orders.
“Funding” shall mean, collectively, (a) the “Purchase Price” and “Purchase Price Increase” as defined under each Repurchase Agreement, as applicable, and (b) the “VFN Draw” as defined under each Indenture.
“GA Selling and Servicing Agreements” shall mean, collectively, the Ditech/Fannie Agreement, the Ditech/Freddie Agreement, the Ditech/Ginnie Agreement and the RMS/Ginnie/HUD Agreements.
“GAAP” means generally accepted accounting principles in effect from time to time in the United States of America and applied on a consistent basis.
“Governing Agreements” shall mean, collectively, the Repurchase Agreements and the Indentures.
“Guarantor” shall have the meaning assigned to such term in the Preamble.
“Hedging Transaction” shall mean, any transaction that constitutes a short sale of a U.S. Treasury Security, or any transaction related to an ISDA or Master Securities Forward Transaction Agreement, futures contract, or options related contract, or swap, cap or collar agreement.
“HUD” means the United States Department of Housing and Urban Development or any successor thereto.
“Immediate Event of Default” shall mean the occurrence of any of the following:  (i) the loss of any DIP Seller’s status as either (x) an approved servicer or (y) an approved issuer, with Fannie Mae, Freddie Mac, or Ginnie Mae, as applicable, (ii) the Event of Default set forth in Section 5.21 hereof titled “Exercise of Remedies by Other Creditors”, (iii) the Event of Default set forth in Section 5.9 hereof titled “Conversion of any of the Cases”, or (iv) the DIP Maturity Date Event of Default.
“Indentures” shall have the meaning assigned to such term in the Recitals.
“Initial Maximum Combined Purchase Price” shall mean ONE BILLION NINE HUNDRED MILLION DOLLARS ($1,900,000,000).
“Interim Cash Management Order” shall mean an interim order entered by the Bankruptcy Court related to the Cases, in form and substance satisfactory to Administrative Agent and the 

9
2014058.10-NYCSR07A - MSW

Buyers, authorizing, inter alia, Ditech to continue using existing cash management system, bank accounts and business forms and implementing changes to the cash management system.
“Interim DIP Order” shall mean an interim financing and cash collateral order entered by the Bankruptcy Court related to the Cases, and in the form substantially attached hereto as Exhibit B or otherwise in form and substance satisfactory to the Administrative Agent and the Buyers.
“Interim Ditech OCB Order” shall mean an interim order entered by the Bankruptcy Court related to Ditech’s Case, in form and substance satisfactory to Administrative Agent and the Buyers, authorizing, inter alia, Ditech to continue in the ordinary course to perform its obligations under (x) the Ditech/Fannie Agreement, (y) the Ditech/Freddie Agreement, and (z) the Ditech/Ginnie Agreement.
“Interim OCB Orders” shall mean, collectively, the Interim Ditech OCB Order and the Interim RMS OCB Order.
“Interim RMS OCB Order” shall mean an interim order entered by the Bankruptcy Court related to RMS’ Case, in form and substance satisfactory to Administrative Agent and the Buyers, authorizing, inter alia, RMS to perform under all RMS/Ginnie/HUD Agreements.
“Lien” shall mean any mortgage, lien, pledge, charge, security interest or similar encumbrance.
“Limited Guaranty” shall mean, with respect to each Indenture and the related Program Agreements, the limited guaranty obligations of the Guarantor contained in any Receivables Sale Agreement (as defined in such Indenture) in respect of the transactions contemplated by such Indenture.
“Master DIP Fee Letter” shall mean that certain Master DIP Fee Letter, dated as of the Effective Date, among Administrative Agent, Buyers, Ditech, RMS and acknowledged by the Guarantor, as may be amended, restated or supplemented or otherwise modified from time to time.
“Master Refinancing Agreement” shall have the meaning assigned to such term in the Preamble.
“Material Adverse Effect” shall mean (a) a material adverse change in, or a material adverse effect upon, the operations, business, properties, or condition (financial or otherwise) of a DIP Seller, or any affiliate thereof that is a party to any DIP Warehouse Facility Agreement taken as a whole, other than as customarily occurs as a result of events leading up to and following the commencement of a proceeding under chapter 11 of the Bankruptcy Code by the Debtors and the commencement of the Cases or any Specified Act of Insolvency with respect to the Guarantor or any Seller; (b) a material impairment of the ability of a DIP Seller, Guarantor or any affiliate thereof that is a party to any DIP Warehouse Facility Agreement to perform under any DIP Warehouse Facility Agreement and to avoid any Event of Default; or (c) a material adverse effect upon the legality, validity, binding effect or enforceability of any DIP Warehouse Facility Agreement against a DIP Seller, Guarantor or any affiliate thereof that is a party to any DIP Warehouse Facility Agreement, in each case as 

10
2014058.10-NYCSR07A - MSW

determined by the Administrative Agent (at the direction of the Required Buyers in their sole discretion).
“Maximum Available Funding” shall have the meaning assigned to such term in the Administration Agreement.
“Maximum Combined Purchase Price” shall mean the Initial Maximum Combined Purchase Price, which amount shall automatically and permanently be reduced on a dollar-for-dollar basis by the amount of any permanent reduction to the Maximum Available Funding under any of the Governing Agreements.
“MSFTA” shall mean, collectively, the Barclays MSFTA, the Nomura MSFTA, and any Designated MSFTA.
“MSFTA Counterparties” shall mean, collectively, (a) Barclays Capital, (b) Nomura Securities, and (c) any other Buyer under the Ditech Repurchase Agreement, or Affiliate of such a Buyer, that is party to a Designated MSFTA, in each case, in its capacity as a party to an MSFTA.
“National Founders Facility” shall mean that certain Participation Interest Sale and Contribution Agreement, dated as of October 1, 2018, by and among RMS and RMS 2018-09, LLC, and the related Note Purchase Agreement of even date therewith, between RMS 2018-09, LLC and National Founders LP.
“Net Worth” means, with respect to any Seller, an amount equal to, on a consolidated basis, such Seller’s stockholder equity (determined in accordance with GAAP).
“Netting Agreement” shall mean that certain Margin, Setoff And Netting Agreement, dated as of the Effective Date, among Administrative Agent, the Buyers party thereto, the MSFTA Counterparties party thereto, DIP Sellers, and acknowledged by Guarantor, in form and substance acceptable to Barclays, as amended, restated, supplemented or otherwise modified from time to time.
“Nomura” shall have the meaning assigned to such term in the Preamble.
“Nomura MSFTA” shall mean that certain Master Securities Forward Transaction Agreement, dated as of May 20, 2013, between Nomura Securities and Ditech, as amended by that certain Amendment dated as of July 11, 2017, as further amended, restated, supplemented or otherwise modified from time to time.
“Nomura Securities” shall have the meaning assigned to such term in the Preamble.
“Non-Recourse Indebtedness” means an obligation for borrowed money secured by a lien on any property owned by a Person, with respect to which obligation the Person has not assumed or become liable for the payment thereof. 

11
2014058.10-NYCSR07A - MSW

“Officer’s Compliance Certificate” shall mean an officer’s certificate substantially in the form attached hereto as Exhibit C or such other form as is reasonably acceptable to the Administrative Agent.
“Original Hedges” shall have the meaning assigned to such term in Section 5.18.
“Person” shall mean an individual, partnership, corporation (including a business trust), limited liability company, joint stock company, trust, unincorporated association, joint venture or other entity, or a government or any political subdivision or agency thereof.
“Petition Date” shall mean the date of the filing of the chapter 11 petitions commencing the Cases.
“Prepetition 1L Agent” shall mean the “First Lien Term Loan Agent” (as such term is defined in the DIP Orders).
“Prepetition 1L Credit Agreement” shall mean the “First Lien Term Loan Credit Agreement” (as such term is defined in the DIP Orders).
“Prepetition 1L Lenders” shall mean the “First Lien Term Loan Lenders” (as such term is defined in the DIP Orders).
“Prepetition 1L Secured Parties” shall mean the “First Lien Term Loan Parties” (as such term is defined in the DIP Orders).
“Prepetition 1L/2L Documents” shall have the meaning assigned to such term in the DIP Orders.
“Prepetition 1L/2L Parties” shall have the meaning assigned to such term in the DIP Orders.
“Prepetition 2L Trustee” shall mean the “Second Lien Notes Indenture Trustee” (as such term is defined in the DIP Orders).
“Prepetition Warehouse Facility Agreements” shall mean the agreements identified on Exhibit A hereto. 
“Prior SAF Agency Agent” shall have the meaning assigned to such term in the Recitals.
“Prior SAF PLS Agent” shall have the meaning assigned to such term in the Recitals.
“Program Agreements” shall mean (a) with respect to the Ditech Repurchase Agreement, “Program Agreements” as defined therein, (b) with respect to the RMS Repurchase Agreement, “Program Documents” as defined therein, (c) with respect to any other Repurchase Agreement “Program Agreements” or “Program Documents”, as the case may be, as defined in such Repurchase Agreement, (d) with respect to the SAF Agency Indenture, “Transaction Documents” as defined therein, and (e) with respect to the SAF PLS Indenture, “Transaction Documents” as defined therein.

12
2014058.10-NYCSR07A - MSW

“Purchased Assets” shall have the meaning assigned to such term in the Recitals.
“REO Subsidiary” shall have the meaning assigned to such term in the Preamble.
“Repurchase Agreements” shall mean, collectively, (a) the Ditech Repurchase Agreement, (b) the RMS Repurchase Agreement, and (c) any DIP HMBS Repurchase Agreement.
“Required Buyers” shall have the meaning assigned to such term in the Administration Agreement.
“RMS” shall have the meaning assigned to such term in the Preamble.
“RMS Repurchase Agreement” shall have the meaning assigned to such term in the Recitals.
“RMS/Ginnie/HUD Agreements” shall mean all applicable agreements with RMS, on the one hand, and Ginnie Mae and/or HUD, on the other hand, together with all supplements, addenda and amendments thereto and incorporating all the applicable guides.
“RSA” shall mean that certain Restructuring Support Agreement, dated as of February 8, 2019, among the Guarantor and the Prepetition 1L Lenders party thereto as “Consenting Term Lenders” (as defined therein).
“SAF Agency Depositor” shall mean Ditech Agency Advance Depositor LLC, as Depositor under and as defined in the SAF Agency Indenture.
“SAF Agency Indenture” shall have the meaning assigned to such term in the Recitals.
“SAF Agency Indenture Supplement” shall have the meaning assigned to such term in the Recitals.
“SAF Agency Indenture Trustee” shall have the meaning assigned to such term in the Recitals.
“SAF Agency Issuer” shall have the meaning assigned to such term in the Recitals.
“SAF Agency Noteholders” shall mean Barclays and each other Noteholder of the Series 2019-VF1 Notes (as such terms are defined in the SAF Agency Indenture) and their respective successors in interest and permitted assigns in such capacity.
“SAF PLS Depositor” shall mean Ditech PLS Advance Depositor LLC, as Depositor under and as defined in the SAF PLS Indenture.
“SAF PLS Indenture” shall have the meaning assigned to such term in the Recitals.
“SAF PLS Indenture Supplement” shall have the meaning assigned to such term in the Recitals.
“SAF PLS Indenture Trustee” shall have the meaning assigned to such term in the Recitals.

13
2014058.10-NYCSR07A - MSW

“SAF PLS Issuer” shall have the meaning assigned to such term in the Recitals.
“SAF PLS Noteholders” shall mean Barclays and each other Noteholder of the Series 2019-VF1 Notes (as such terms are defined in the SAF PLS Indenture) and their respective successors in interest and permitted assigns in such capacity.
“SAF SPVs” shall have the meaning assigned to such term in the Recitals.
“Sale Agreement” shall have the meaning assigned to such term in Article 8.
“Sale Order” shall have the meaning assigned to such term in Article 8.
“Secured Obligations” shall mean, collectively, the obligations of the Guarantor, each DIP Seller, each Depositor, each SAF SPV and their respective Affiliates under each of the DIP Warehouse Facility Agreements (including the Obligations).
“Secured Parties” shall mean the Administrative Agent, the Buyers, the MSFTA Counterparties and any other holder of the Secured Obligations.
“Sellers” shall have the meaning assigned to such term in the Preamble.
“Specified Act of Insolvency” shall mean the occurrence of any Act of Insolvency specified in clause (a) (with respect to a chapter 11 proceeding under the Bankruptcy Code) or clause (e) of the definition of “Act of Insolvency”.
“Stated Termination Date” shall mean the date that is 180 days after the Petition Date. 
“Termination Date” shall mean the earliest to occur of (a) the Stated Termination Date, (b) the acceleration of any of the Secured Obligations and the termination of the commitments of the Buyers under any of the Governing Agreements to make Fundings thereunder as a result of an exercise of remedies pursuant to Article 6, (c) the substantial consummation (as defined in Section 1101(2) of the Bankruptcy Code, which for purposes hereof shall be no later than the effective date thereof) of a chapter 11 plan of reorganization in any of the Cases that is confirmed pursuant to an order entered by the Bankruptcy Court, and (d) the consummation of a sale under section 363 of the Bankruptcy Code of all or substantially all of the assets of the Debtors.
“Unrestricted Cash” means for any Seller, any amount of cash and cash equivalents of such Seller that is not contractually required to be set aside, segregated or otherwise reserved, which may include cash and cash equivalents on deposit in any bank accounts of such Seller subject to the Prepetition 1L/2L Security Interests or the Adequate Protection Liens (as such terms are defined in the DIP Orders) (but only to the extent such Seller is authorized to use such cash collateral in the ordinary course of its business pursuant to the DIP Orders); provided that, with respect to RMS, for purposes of the liquidity covenant set forth in Section 4.4(b), “Unrestricted Cash” shall also include any cash and cash equivalents of RMS on deposit in the RMS DIP Liquidity Account (as defined in the Cash Management Orders), notwithstanding that such cash and/or cash equivalents may be noted as “restricted cash” on the financial statements of RMS.

14
2014058.10-NYCSR07A - MSW

“VFN Draws” shall have the meaning assigned to such term in the Recitals.
“Wells Fargo” shall have the meaning assigned to such term in the Recitals.

ARTICLE 2:    CONDITIONS PRECEDENT TO  
EFFECTIVE DATE AND INITIAL FUNDINGS
•Conditions Precedent to Effective Date and Initial Fundings.  This Master Refinancing Agreement, the Repurchase Agreements, and the Indenture Supplements shall become effective (as well as the other DIP Warehouse Facility Agreements contemplated to become effective concurrently with the foregoing), and the obligation of the Committed Buyers to fund their respective Pro Rata Portions (as defined in the Administration Agreement) of the initial Fundings under the Governing Agreements shall be subject to the satisfaction of the following conditions precedent, which may only be waived by the Administrative Agent (at the direction of Required Buyers):
1.    The Administrative Agent shall have received:
(a)    this Master Refinancing Agreement, duly executed and delivered by the Administrative Agent, Buyers, the DIP Sellers, and the Guarantor; and
(b)    each Repurchase Agreement, the SAF Agency Indenture Supplement, the SAF PLS Indenture Supplement, the Netting Agreement, the DIP Guaranty, the Administration Agreement, the Depositor Equity Pledge Agreement, each MSFTA and each other DIP Warehouse Facility Agreement, in each case, duly executed and delivered by each party thereto, each in form and substance satisfactory to the Administrative Agent (at the direction of Required Buyers in their sole discretion);
2.    Payment of (a) all fees due and payable at such time pursuant to the Master DIP Fee Letter and (b) all other fees, costs and expenses of Administrative Agent and Buyers incurred in connection with the negotiation, preparation and administration of the DIP Warehouse Facility Agreements and in connection with matters related to any of the Cases, including all reasonable legal fees and expenses; in each case, then due and payable pursuant to the Commitment Letter or Article 7 hereof; 
3.    Evidence that all other actions necessary or, in the opinion of Administrative Agent (at the direction of Required Buyers), reasonably desirable to perfect and protect the Secured Parties’ interest in the Collateral under each DIP Warehouse Facility Agreement and the security interest granted under the Netting Agreement and Depositor Equity Pledge Agreement have been taken, including, without limitation, duly authorized and filed Uniform Commercial Code financing statements on Form UCC 1 and UCC-3, as applicable;
4.    Delivery of a certificate of a duly authorized Person of Guarantor, each DIP Seller, each Depositor and each SAF SPV, (a) attaching certified copies of Guarantor’s, each DIP Seller’s, each Depositor’s and each SAF SPV’s organizational documents and resolutions, as applicable, approving the DIP Warehouse Facility Agreements to which such Person is a party (either specifically or by general resolution or pursuant to the related organizational documents) and (b) 

15
2014058.10-NYCSR07A - MSW

certifying that all necessary action or material governmental approvals as may be required in connection with the DIP Warehouse Facility Agreements have been obtained and are in full force and effect; 
5.    Delivery of a certified copy of a good standing certificate from the jurisdiction of organization of Guarantor, each DIP Seller, each Depositor and each SAF SPV, dated within ten (10) Business Days of the Effective Date; 
6.    An incumbency certificate of Guarantor, each DIP Seller, each Depositor and each SAF SPV, certifying the names, true signatures and titles of the representatives duly authorized to request transactions under and to execute the DIP Warehouse Facility Agreements, as applicable;
7.    With respect to the each Indenture:
(a)    Execution and delivery of each variable funding note issued pursuant to each Indenture for agency servicing/delinquency advances and non-agency servicing/monthly advances, each registered or submitted to be re-registered (as the case may be) in the name of Barclays and delivered to, or held for, Barclays; and
(b)    Execution and delivery of the documents listed on Part A of Schedule I hereto;
8.    Delivery from DIP Sellers’ outside counsel of the legal opinions listed on Part B of Schedule I hereto, in each case, in form and substance acceptable to Buyers;
9.    The Bankruptcy Court shall have entered the Interim DIP Order, the Interim Cash Management Order and the Interim OCB Orders in connection with the Cases, and the Interim DIP Order, the Interim Cash Management Order and the Interim OCB Orders shall be in full force and effect, and shall not have been (i) vacated, reversed, or stayed, or (ii) amended or modified except as otherwise agreed to in writing by the Administrative Agent (at the direction of the Required Buyers);
10.    No uncured Event of Default or uncured Default under any DIP Warehouse Facility Agreement shall exist; 
11.    Accuracy in all material respects of representations and warranties provided by Guarantor, DIP Sellers, Depositors and SAF SPVs in the DIP Warehouse Facility Agreements;
12.    Payoff and termination of all obligations under the Prepetition Warehouse Facility Agreements, and the Administrative Agent shall have received evidence reasonably satisfactory to it with respect to such payoff and termination;
13.    No suspension or loss of any DIP Seller’s status as either (x) an approved servicer or (y) an approved issuer, with Fannie Mae, Freddie Mac, or Ginnie Mae, as applicable, and no termination of any of the GA Selling and Servicing Agreements;  

16
2014058.10-NYCSR07A - MSW

14.    With respect to each Repurchase Agreement, no material disruption of claims payments on FHA insured loans shall have occurred (other than any such material disruption that is generally affecting non-bank mortgage servicers and originators with similar claims); 
15.    Receipt by Administrative Agent, Buyers and MSFTA Counterparties of requested “know your customer” information;
16.    Receipt by Administrative Agent and the Buyers of (a) daily cash flow forecasts with supporting detail, and (b) monthly cash flow forecasts with supporting detail through December 31, 2019, in each case, in form and substance reasonably satisfactory to the Buyers; 
17.    Fannie Mae shall have acknowledged Barclays replacing the Prior SAF Agency Agent as designee for purposes of the existing Fannie Mae Acknowledgement Agreement (as defined in the SAF Agency Indenture), which acknowledgement shall be in form and substance reasonably satisfactory to Barclays;
18.    Administrative Agent and Buyers not having discovered or otherwise having become aware of any information not previously disclosed to them that they believe to be inconsistent in a material and adverse manner with their understanding, based on the information provided to them prior to the date of the Commitment Letter, of the business, assets, liabilities, operations, financial conditions and operating results of the Guarantor and its subsidiaries or each DIP Seller and their respective subsidiaries, in each case, taken as a whole; 
19.    Compliance by the Guarantor and DIP Sellers in all material respects with the terms of the Commitment Letter and each Fee Letter (as defined therein) (including payment of fees and expenses as the same become due and payable and that no breach in any material respect of the representations, warranties and agreements contained in Section 2 of such Commitment Letter shall have occurred and be continuing); and
20.    The Guarantor shall have (a) entered into the RSA with Prepetition 1L Lenders holding at least two-thirds of the aggregate principal amount of loans outstanding under the Prepetition 1L Credit Agreement, and (b) executed and delivered a certification that (i) there has been no modification or amendment to the RSA since the execution thereof and (ii) the “Support Period” (as defined in the RSA) has commenced and is continuing, in each case, in form and substance acceptable to the Administrative Agent and the Buyers.
A.Third Party Beneficiary.  The parties hereto acknowledge and agree that Wells Fargo, as SAF Agency Indenture Trustee and SAF PLS Indenture Trustee under Indentures, shall be a third party beneficiary of this Article 2.

ARTICLE 3:    [RESERVED]

17
2014058.10-NYCSR07A - MSW

ARTICLE 4:    CERTAIN COVENANTS
The Guarantor and the DIP Sellers shall comply, and shall cause their respective Subsidiaries to comply, as applicable, with the following covenants:
1.    Use of Proceeds. The proceeds of any Fundings under any Governing Agreement and other extensions of credit under the DIP Warehouse Facility Agreements shall be used (i) to pay off in full any outstanding obligations under the Prepetition Warehouse Facility Agreements as of the Effective Date, (ii) in the case of the Repurchase Agreements, to acquire Purchased Assets, (iii) for general working capital and operational expenses of Sellers and (iv) to pay customary fees and closing costs in connection with the DIP Warehouse Facility Agreements; provided that, proceeds of any Fundings or any Collateral shall not be used for repayment of amounts owing under the National Founders Facility. 
2.    Cash Flow Review Calls.  Upon request by any Buyer from time to time, the Guarantor and the Sellers shall hold a cash flow review call with the Administrative Agent, the Buyers and their respective representatives and advisors; provided that (i) absent an Event of Default, the Guarantor and Sellers shall not be required to have more than one such call during any calendar week and (ii) any such call shall be scheduled at times reasonably agreed to by the requesting Buyer, the Sellers and the Administrative Agent.
3.    DIP Superpriority Claims.  The DIP Superpriority Claims against the Sellers shall have priority over all other administrative expenses, subject and subordinate only to (a) the Carve-Out and (b) the First Lien Term Loan Obligations but solely to the extent they relate to and against, and are payable from, the First Lien Term Loan Collateral only.  The DIP Superpriority Claims against the Guarantor shall have priority over all other administrative expenses, subject and subordinate in all respects only to (a) the Carve-Out and (b) the First Lien Term Loan Obligations but solely to the extent as they relate to and against, and are payable from, the First Lien Term Loan Collateral only.
4.    Maintenance of Liquidity.  
(a)    Ditech shall ensure that, at all times, it has Unrestricted Cash in an amount not less than $5,000,000.
(b)    RMS shall ensure that, at all times, it has Unrestricted Cash in an amount not less than $25,000,000.
5.    Other Ditech Financial Covenants.
(a)    As of the end of each calendar month, Ditech shall maintain an Adjusted Tangible Net Worth at least equal to $400,000,000.
(b)    As of the end of each calendar month, Ditech’s ratio of Warehouse Indebtedness of Ditech (excluding Non-Recourse Indebtedness and excluding all Indebtedness (as defined in the Ditech Repurchase Agreement) (i) that is not reflected on 

18
2014058.10-NYCSR07A - MSW

Ditech’s financial statements or (ii) of Ditech in respect of the Prepetition 1L Credit Agreement) to Adjusted Tangible Net Worth of Ditech shall not exceed 10:1.
6.    Other RMS Financial Covenants.
(a)    As of the end of each calendar month, RMS shall maintain an Adjusted Tangible Net Worth at least equal to $60,000,000.
(b)    As of the end of each calendar month, RMS’s ratio of Warehouse Indebtedness of RMS (excluding Non-Recourse Indebtedness and all HMBS security obligations and any other securitization obligations of RMS and excluding all Indebtedness (as defined in the RMS Repurchase Agreement) that is not reflected on RMS’s financial statements) to Adjusted Tangible Net Worth of RMS shall not exceed 10:1.
7.    National Founders Facility.  None of the proceeds of any Collateral or the proceeds of any Funding or other extension of credit under any of the DIP Warehouse Facility Agreements shall be used in any respect of the National Founders Facility.
8.    Agency Reporting.  The Debtors shall (i) timely comply with all informational and reporting requests and requirements of any Agency in connection with the Cases, (ii) promptly after delivery thereof furnish to the Administrative Agent and the Buyers copies of any formal written responses and reporting so delivered to any Agency, and (iii) promptly notify the Administrative Agent and the Buyers of any material conditions imposed by any Agency in connection with any DIP Seller’s continuing status as an approved servicer or issuer and/or forbearance by such Agency with respect to any of the GA Selling and Servicing Agreements.

ARTICLE 5:    EVENTS OF DEFAULT
Each of the following shall constitute an “Event of Default” hereunder and under each of the Governing Agreements:
1.    Failure to Enter Interim DIP Order. Within five (5) Business Days following the Petition Date, the Bankruptcy Court fails to enter the Interim DIP Order; 
2.    Failure to Draw. Within five (5) Business Days following the Petition Date, DIP Sellers fail to enter into a new Transaction under each Governing Agreement;
3.    Failure to Enter Final DIP Order, Final Cash Management Order or Final OCB Orders. Within thirty-five (35) calendar days following the entry of the Interim DIP Order, the Bankruptcy Court fails to enter the Final DIP Order, the Final Cash Management Order or any Final OCB Order; 
4.    Failure to Pay Administrative Agent for its own account or the account of any Buyer. Failure to (a) make any payment of Price Differential or Repurchase Price or make a payment of any other sum or amount which has become due, whether by acceleration or otherwise, under any of the DIP Warehouse Facility Agreements, including, without limitation, payment in full in cash 

19
2014058.10-NYCSR07A - MSW

by the Termination Date or (b) pay any Margin Deficit when due pursuant to any Repurchase Agreement;
5.    Breach of Representation. Any representation or warranty of Guarantor, any DIP Seller, any Depositor or any SAF SPV under this Master Refinancing Agreement the DIP Guaranty or any other DIP Warehouse Facility Agreement is materially incorrect;
6.    Breach of Covenant. A breach of any covenant or agreement of Guarantor, any DIP Seller, any Depositor or any SAF SPV under this Master Refinancing Agreement, the DIP Guaranty or any other DIP Warehouse Facility Agreement;
7.    Breach of DIP Orders. The occurrence of a breach or violation of the Interim DIP Order (or, after entry thereof, the Final DIP Order) that has not been promptly cured or waived to the satisfaction of the Administrative Agent (at the direction of the Required Buyers in their sole discretion);
8.    Breach of OCB Orders or Cash Management Order. The occurrence of a breach or violation of any Interim OCB Order (or, after entry thereof, any Final OCB Order) or the Interim Cash Management Order (or, after entry thereof, the Final Cash Management Order), in each case, that has not been promptly cured or waived to the satisfaction of the Administrative Agent (at the direction of Required Buyers in their sole discretion);
9.    Conversion of any of the Cases. The conversion of any of the Cases to a case under chapter 7 of the Bankruptcy Code; 
10.    Dismissal of any of the Cases. The dismissal of any of the Cases;
11.    Appointment of a Chapter 11 Trustee; Loss of Exclusivity. (a) Appointment of a chapter 11 trustee in any of the Cases pursuant to section 1104 of the Bankruptcy Code, or (b) any Debtor loses the exclusive right to file a chapter 11 plan or plans in any of the Cases or to solicit acceptances thereof pursuant to section 1121 of the Bankruptcy Code; 
12.    Chapter 11 Milestones.  After entry of the Final DIP Order, the Debtors fail to comply with any of the Chapter 11 Milestones in accordance with Article 8;
13.    Modification of DIP Orders or Certain Other Orders. Any reversal, revocation or modification of any of the following orders without the prior written consent of the Administrative Agent (at the direction of the Required Buyers in their sole discretion) (in the case of subclause (d) below, other than a modification that is not adverse to any of the rights, claims or interests of any Secured Party): (a) the Interim DIP Order (or, after entry thereof, the Final DIP Order), (b) any Interim OCB Order (or, after entry thereof, any Final OCB Order), (c) after entry thereof, any order referred to in clause (e) of the Chapter 11 Milestones, (d) after entry thereof, any of the other orders referred to in the Chapter 11 Milestones or (e) the Interim Cash Management Order (or, after entry thereof, the Final Cash Management Order);

20
2014058.10-NYCSR07A - MSW

14.    Loss or Suspension of Servicer or Issuer Status. Any Agency (a) removes or suspends any DIP Seller’s status as an approved servicer or issuer, (b) terminates of any of the GA Selling and Servicing Agreements, or (c) engages in any setoff against any Collateral;
15.    Order Granting Relief of Automatic Stay to Third Party. The entry of an order of the Bankruptcy Court granting any Person other than the Secured Parties (in their capacities as such) relief from the automatic stay in any of the Cases in a manner that is materially adverse to the rights, claims or interests of any of the Secured Parties; 
16.    Order Granting Lien or Claim to Third Party. The entry of an order of the Bankruptcy Court granting any Person other than the Secured Parties (in their capacities as such) a Lien or claim in or against (a) any of the Collateral, or (b) any other material assets of Guarantor, a DIP Seller, any other Debtor, any Depositor or any SAF SPV (other than, solely with respect to assets that do not, and are not required to, constitute Collateral, (i) Liens existing as of the Petition Date granted to the Prepetition 1L Agent and the Prepetition 2L Trustee pursuant to the Prepetition 1L/2L Documents on assets of the Debtors, (ii) adequate protection Liens granted to the Prepetition 1L Agent and the Prepetition 2L Trustee in accordance with the DIP Orders on assets of the Debtors, (iii) Liens permitted under the Prepetition 1L Credit Agreement (as amended and in effect on the date of the Commitment Letter) and DIP Warehouse Facility Agreements; provided that it shall constitute an Event of Default if any of the DIP Sellers, Guarantor, any other Debtor, any SAF SPV or any Depositor shall grant any Lien to secure any indebtedness or obligations referred to in clause (17) below or (iv) as otherwise provided in the DIP Orders);
17.    Additional Indebtedness. Guarantor, a DIP Seller, any other Debtor, a SAF SPV or a Depositor (a) issues or incurs, or files a motion to issue or incur, any additional secured or unsecured term loan debt, debt bonds, or other debt for borrowed money, or (b) enters into, or files a motion to approve, any other debt arrangements similar to a DIP Warehouse Facility Agreement;
18.    Other Hedges. Without the prior written consent of Administrative Agent (at the direction of Required Buyers): (a) Guarantor, a DIP Seller, any other Debtor, a SAF SPV or a Depositor enters into any Hedging Transactions, other than transactions with Ditech pursuant to hedging agreements identified in writing by the DIP Sellers to the Buyers on February 7, 2019 (the “Original Hedges”) or (b) any guaranties are provided in connection with any of the Original Hedges or any other Hedging Transaction; 
19.    Chapter 11 Plan Filing. The filing of any chapter 11 plan of reorganization (or a disclosure statement describing a chapter 11 plan of reorganization) in any of the Cases or any motion to approve the Sale Agreement, any plan support agreement or any other asset purchase agreement or similar agreement, in any such case, that does not provide that all obligations of the Guarantor, the DIP Sellers, the SAF SPVs, and the Depositors with respect to the DIP Warehouse Facility Agreements, the DIP Guaranty and this Master Refinancing Agreement shall be paid in full in cash as per the terms of such agreements (other than with respect to any other asset purchase agreement or similar agreement relating to a sale or disposition on terms and conditions consented to by the Buyers, subject to any applicable prepayment requirements set forth herein or in any other DIP Warehouse Facility Agreement);

21
2014058.10-NYCSR07A - MSW

20.    RSA Termination. (a) The RSA is (i) terminated or (ii) amended, waived or otherwise modified in a manner that is materially adverse to the rights, claims or interests of any of the Secured Parties, or (b) the “Consenting Term Lenders” under and as defined in the RSA fail to hold at least two-thirds of the aggregate principal amount of loans outstanding under the Prepetition 1L Credit Agreement and such failure continues unremedied for a period of five (5) consecutive Business Days;
21.    Exercise of Remedies by Other Creditors. Exercise by any Prepetition 1L/2L Party or any other creditor or any agent, trustee or other representative on behalf of any creditor (other than Administrative Agent or the Required Buyer in accordance with the Administration Agreement and other relevant DIP Warehouse Facility Agreements) of remedies (a) against any Collateral, or (b) in a manner that is materially adverse to the rights, claims or interests of any of the Secured Parties;
22.    [Reserved]. 
23.    Sale Agreement.  The Sale Agreement at any time after execution thereof shall be (i) amended in a manner that results in such Sale Agreement no longer complying with the requirements set forth herein and in the other DIP Warehouse Facility Agreements or (ii) withdrawn or terminated, unless such Sale Agreement is replaced within thirty (30) days by a replacement Sale Agreement that is an Acceptable Sale Agreement; provided that this Section 5.23 shall cease to apply in the event that Section E.2 of the Chapter 11 Milestones no longer applies pursuant to the proviso set forth at the end of Article 8;
24.    Sale, Transfer or Disposition of Servicing Rights. Any sale, transfer or other disposition of (i) any mortgage servicing rights with respect to any mortgage loans (including any manufactured housing loans) or rights to reimbursement for advances related thereto or (ii) any other assets of the Guarantor, any DIP Seller, any other Debtor, any Depositor or any SAF SPV and, in the case of this subclause (ii), the sale, transfer or other disposition of such other asset would materially impair the rights and claims of any of the Secured Parties (as determined by Required Buyers in their sole discretion) in and to the Collateral (other than the sale, transfer or other disposition of such servicing rights or assets occurring in the ordinary course; provided that the outstanding Repurchase Price or other Secured Obligations (including any accrued and unpaid interest and fees with respect thereto) owed to any of the Secured Parties with respect to such sold mortgage servicing rights or any rights to reimbursement for advances related thereto or, to the extent constituting Collateral, other sold assets shall be repaid no later than substantially concurrently with such sale, transfer or other disposition);
25.    Failure to Pay at Maturity. The occurrence of a DIP Maturity Date Event of Default;
26.    MSFTA Cross Default. An “event of default” (as such term is defined in the applicable MSFTA) (in each case, subject to any applicable cure period) occurs under any MSFTA (as defined herein);
27.    Insolvency. An Act of Insolvency shall have occurred with respect to the REO Subsidiary, any Depositor or any SAF SPV; 

22
2014058.10-NYCSR07A - MSW

28.    Inability to Perform. Any DIP Seller, Guarantor, any Depositor or any SAF SPV shall admit its inability to, or its intention not to, perform such Person’s obligations under any of the DIP Warehouse Facility Agreements to which it is a party; provided that the filing of any of the Cases or any Specified Act of Insolvency with respect to the Debtors hall not, in and of itself, be deemed any admission of Person’s inability to perform; 
29.    Change in Control.  The occurrence of a Change in Control;
30.    Failure to Transfer.  Any DIP Seller fails to transfer the Purchased Assets to Administrative Agent or its designee on the applicable Purchase Date (provided that the applicable Buyers (or the Administrative Agent, on behalf of the applicable Buyers) have tendered the related Purchase Price);
31.    Judgment.  A post-petition final judgment or judgments for the payment of money in excess of $5,000,000 in the aggregate shall be rendered against any DIP Seller or Guarantor by one or more courts, administrative tribunals or other bodies having jurisdiction and the same shall not be satisfied, discharged (or provision shall not be made for such discharge) or bonded, or a stay of execution thereof shall not be procured, within thirty (30) days from the date of entry thereof; 
32.    Government Action.  Any Governmental Authority or any person, agency or entity acting or purporting to act under governmental or regulatory authority (i) shall have taken any action to condemn, seize or appropriate, or to assume custody or control of, all or any substantial part of the property of any DIP Seller, Guarantor or any Affiliate thereof, (ii) shall have taken any action to displace the management of any DIP Seller, Guarantor or any Affiliate thereof or (iii) shall have taken any action to curtail its authority in any material respect in the conduct of the business of any DIP Seller, Guarantor or any Affiliate thereof, or any enforcement action that either materially impairs the ability of any DIP Seller, the Guarantor, any Depositor or any SAF SPV to perform its obligations under the DIP Warehouse Facility Agreements or prevents it from carrying on its business or a substantial part thereof, and, in the case of this subclause (iii), such action shall not have been discontinued or stayed within thirty (30) days; 
33.    Servicer Default.  Any third party servicer of any Purchased Assets is in default of the applicable servicing agreement entered into between such servicer and any Seller, and the relevant Seller has not, within thirty (30) days of such default, (i) replaced such servicer with a successor servicer approved by Administrative Agent in its sole discretion or (ii) repurchased all Purchased Assets subject to such servicing agreement or any other servicing agreement with such servicer;
34.    Indenture Cross Default. The occurrence of an “Event of Default” (as such term is defined under each Indenture), or the failure to timely pay any “Target Amortization Amount” (as such term is defined under each Indenture) when due and payable; 
35.    Assignment. Assignment or attempted assignment by any DIP Seller, Guarantor, any Depositor or any SAF SPV of any DIP Warehouse Facility Agreement to which it is a party or any of its rights or obligations thereunder without first obtaining the specific written consent of Administrative Agent (at the direction of the Required Buyers in their sole discretion), or the granting 

23
2014058.10-NYCSR07A - MSW

by any DIP Seller of any security interest, lien or other encumbrances on any Purchased Assets to any person other than Administrative Agent or any custodian or agent acting on behalf of the Administrative Agent and relevant Buyers; 
36.    Security Interest. Any of the DIP Warehouse Facility Agreements shall for any reason cease to create a valid, first priority security interest in any material portion of the Collateral purported to be covered thereby;
37.    Occurrence of any other Event of Default.  The occurrence of any other event of default under any DIP Warehouse Facility Agreement (beyond any grace period, and subject to any express notice requirement, set forth in such DIP Warehouse Facility Agreement that is applicable to such event) that has not been promptly cured or waived to the satisfaction of the Administrative Agent (at the direction of the Required Buyers in their sole discretion);
38.    Enforceability.  For any reason (i) any DIP Seller, Guarantor, Depositor or SAF SPV shall seek to disaffirm, terminate, limit, challenge, repudiate or reduce its obligations under any DIP Warehouse Facility Agreement or otherwise challenge the ability of Administrative Agent, any Buyer or any other Secured Party to enforce its rights and remedies thereunder or (ii) any DIP Warehouse Facility Agreement at any time shall fail to be in full force and effect in all material respects in accordance with its terms or shall not be enforceable in all material respects in accordance with its terms;
39.    Cash Collateral Termination Event.  The occurrence of a Cash Collateral Termination Event (as defined in the DIP Orders).
An Event of Default shall be deemed to be continuing unless expressly waived by Administrative Agent (at the direction of the Required Buyers in their sole discretion) in written notice to the DIP Sellers.

ARTICLE 6:    REMEDIES
Notwithstanding anything to the contrary in this Master Refinancing Agreement or in any other DIP Warehouse Facility Agreement, upon the occurrence and during the continuance of an Event of Default, the Administrative Agent (at the direction of the Required Buyers in their sole discretion) shall: (a) deliver a notice of an Event of Default; (b) terminate any pending Funding or other extension of credit under any DIP Warehouse Facility Agreement; (c) declare the Secured Obligations to be due and payable; (d) place an administrative hold on any deposit account, securities account or other bank account that constitutes Collateral; and (e)(i) immediately upon the occurrence of any Immediate Event of Default, and (ii) upon three (3) Business Days’ written notice to Ditech, RMS and the Guarantor in the case of any Event of Default (other than an Immediate Event of Default), exercise all other rights and remedies available to the Administrative Agent (at the direction of the Required Buyers in their sole discretion), any Buyer and/or any other Secured Party pursuant to any of the DIP Warehouse Facility Agreements, DIP Guaranty, the DIP Orders and any other order of the Bankruptcy Court or otherwise.  The rights and remedies set forth in this Article 6 may be exercised without presentment, demand, protest or other notice of any kind (except for any notice expressly required in this Article 6), all of which are hereby expressly waived by each of the DIP 

24
2014058.10-NYCSR07A - MSW

Sellers, Guarantor, any SAF SPV and any Depositor.  For the avoidance of doubt, upon the occurrence and during the continuance of an Event of Default, the interest rate that is used to calculate amounts due under the Repurchase Agreements (including Price Differential) shall automatically be the Default Rate without any further action required by Administrative Agent or any Buyer party to any Repurchase Agreement.

Upon the occurrence of a DIP Maturity Date Event of Default, the exercise of remedies under any of the Governing Agreements and related Program Agreements may be commenced at the direction of any of the initial Buyers party to such Governing Agreement (or, in the case of an MSFTA, the MSFTA Counterparty party to such MSFTA); provided, however, that to the extent that, and for so long as, each of the following conditions are satisfied (but solely during the 45-day period immediately following the occurrence of the DIP Maturity Date Event of Default) the exercise of such remedies shall only be commenced at the direction of the Required Buyers:

(a)    the Debtors have filed with the Bankruptcy Court an Acceptable Plan or an Acceptable Sale Agreement, as applicable; and

(b)    (i)  a confirmation or sale hearing, as applicable, has been scheduled for the confirmation or approval of such Acceptable Plan or Acceptable Sale Agreement and the Debtors are working to obtain Bankruptcy Court confirmation or approval thereof, or (ii) the Debtors have obtained entry of either an order of the Bankruptcy Court confirming such Acceptable Plan or the Sale Order approving such Acceptable Sale Agreement and are pursuing the effective date or consummation thereof, as applicable; and

(c)    an updated DIP budget is delivered within ten (10) days prior to the occurrence of the DIP Maturity Date Event of Default demonstrating sufficient liquidity for the Debtors and their non-Debtor subsidiaries to the reach the expected effective date of such Acceptable Plan or consummation of the transactions under such Acceptable Sale Agreement, as applicable.

The Administrative Agent (acting at the direction of the Required Buyers in their sole discretion) shall have the right, following the occurrence of an Event of Default, to transfer the existing HUD mortgagee ID numbers for no less than all of the Mortgage Loans that are subject to the RMS Repurchase Agreement to the HUD mortgagee ID number specified by the Administrative Agent; provided that such transfer shall be subject to HUD approval.  The Administrative Agent, Buyers and Sellers agree to negotiate in good faith to modify and supplement the Administration Agreement within thirty (30) days of the Effective Date to reflect certain sub-agency and similar provisions that would apply in the event any such transfer is made to Nomura’s HUD mortgagee ID number pursuant to this paragraph, which modifications shall be in form and substance reasonably satisfactory to the Administrative Agent.  The Administrative Agent will have the option in its sole discretion for such transfer to be made to either Nomura’s or Barclays’ HUD mortgagee ID number. 

25
2014058.10-NYCSR07A - MSW

ARTICLE 7:    FEES AND EXPENSES
Notwithstanding anything to the contrary in any Governing Agreement or any other Program Agreement, DIP Sellers shall pay all of the reasonable costs and expenses of the Administrative Agent and the Buyers, whether incurred before, on or after the Petition Date, including, without limitation, due diligence audit (including per diems), consultant, search, filing and recording fees and all other reasonable out-of-pocket expenses of the Administrative Agent and the Buyers (including the reasonable fees and expenses of (a) separate counsel to each Buyer, (b) appropriate local counsel and regulatory counsel, (c) one counsel to the Administrative Agent or a Buyer delivering any legal opinion required as a condition precedent to the Effective Date and initial Fundings, and (d) following the occurrence of a Default, accountants and other professionals and advisors to the Administrative Agent and the Buyers), as well as all reasonable expenses of the Administrative Agent and the Buyers in connection with the negotiation and preparation, execution, administration (including the preparation, negotiation and execution of any amendments, consents, waivers, assignments, restatements or supplements thereto), monitoring and enforcement of this Master Refinancing Agreement, the DIP Guaranty, and the other DIP Warehouse Facility Agreements and in connection with matters related to any of the Cases.  For the avoidance of doubt, DIP Sellers will pay all of the outstanding legal fees of Buyers on (i) the Effective Date, (ii) at such regular intervals during the Cases as agreed to among the parties and (iii) upon the Termination Date.  

ARTICLE 8:    MILESTONES
The Debtors shall comply with the following chapter 11 milestones (collectively, the “Chapter 11 Milestones”):
A.    On or before the date that is fifteen (15) days following the Petition Date, the Debtors shall have filed with the Bankruptcy Court a motion, in form and substance satisfactory to the Required Buyers, seeking entry of an order by the Bankruptcy Court approving bidding procedures in connection with a 363 sale process pursuant to one or more asset purchase agreements or similar agreements that provide for repayment in full in cash of the obligations under the DIP Warehouse Facility Agreements on the closing of such agreement;
B.    On or before the date that is fifteen (15) days following the Petition Date, the Debtors shall have filed with the Bankruptcy Court an Acceptable Plan and a disclosure statement reasonably satisfactory to the Required Buyers with respect thereto; 
C.    On or before the date that is sixty (60) days following the Petition Date, the Bankruptcy Court shall have approved bidding procedures, in form and substance reasonably acceptable to the Required Buyers, and such approval shall be in full force and effect, and shall not have been (i) vacated, reversed, or stayed, or (ii) amended or modified except as otherwise agreed to in writing by the Required Buyers;
D.    On or before the date that is sixty (60) days following the Petition Date, the Debtors shall have obtained the Bankruptcy Court’s approval of a disclosure statement for an Acceptable Plan and solicitation procedures contemplating completion of a confirmation hearing with respect 

26
2014058.10-NYCSR07A - MSW

to an Acceptable Plan no later than 115 days following the Petition Date, which disclosure statement and solicitation procedures must otherwise be in form and substance reasonably acceptable to the Required Buyers, and the Bankruptcy Court’s approval of such disclosure statement and solicitation procedures shall not have been amended, modified or supplemented (or any portions thereof reversed, stayed or vacated) other than as agreed in writing by the Required Buyers; and
E.    One of the following milestones shall be satisfied on or before the date that is 125 days following the Petition Date: 
1.    the Debtors shall obtain entry of an order of the Bankruptcy Court confirming an Acceptable Plan, which order (i) shall be (x) in form and substance satisfactory to the Required Buyers, to the extent relating to the termination of the commitments under the DIP Warehouse Facility Agreements, the payment in full in cash and full discharge of the obligations under the DIP Warehouse Facility Agreements, and releases and other exculpatory provisions for the Secured Parties and (y) otherwise in form and substance reasonably satisfactory to the Required Buyers, and (ii) shall not have been amended, modified or supplemented (or any portions thereof reversed, stayed or vacated) other than as agreed in writing by the Required Buyers; or
2.    the Bankruptcy Court shall have entered an order approving an asset purchase agreement or similar agreement that provides for repayment in full in cash of the obligations under the DIP Warehouse Facility Agreements on the closing of such agreement (such order, the “Sale Order” and such agreement, the “Sale Agreement”), in form and substance reasonably acceptable to the Required Buyers, and the Sale Order shall be in full force and effect, and shall not have been (i) vacated, reversed, or stayed, or (ii) amended or modified except as otherwise agreed to in writing by the Required Buyers;
provided that, in the event the Board of Directors of the Guarantor and Sellers have determined to no longer pursue the Sale Agreement or a replacement Sale Agreement, then (x) the Guarantor and Sellers shall notify the Administrative Agent and the Buyers thereof no later than the date that is the sum of (A) 95 days plus (B) five (5) Business Days following the Petition Date and (y) Section E.2 above shall cease to be an alternative and the Debtors shall be required to satisfy the Chapter 11 Milestone set forth in Section E.1 above.

ARTICLE 9:    REPORTING
In addition to the reporting requirements set forth in any other DIP Warehouse Facility Agreement, The Guarantor and the DIP Sellers shall furnish to the Administrative Agent and each of the Buyers:

A.    Cash Flow Forecasts.  Daily cash flow forecasts with supporting detail, on a rolling 120-day basis, and (ii) monthly cash flow forecasts with supporting detail through December 31, 2019, in each case, updated weekly and to be delivered on Thursday of each week based on information as of the end of the immediately preceding calendar week, which reporting shall be in a form substantially consistent with such forecasts provided to the Buyers as of the date of the Commitment Letter or in such other form as is reasonably acceptable to the Buyers.

27
2014058.10-NYCSR07A - MSW

B.    Other Reporting.  The same reports, disclosures or other information provided to the Administrative Agent, any of the Prepetition 1L/2L Parties, or their respective advisors in accordance with any order of the Bankruptcy Court.

ARTICLE 10:    CONFLICTS
Notwithstanding anything in the DIP Warehouse Facility Agreements to the contrary, in the event of any conflict between the terms of a DIP Warehouse Facility Agreement and the other related Program Agreements, the documents shall control in the following order of priority:  first, the terms of this Master Refinancing Agreement shall prevail, second, the terms of the related Pricing Side Letter shall prevail, third, the terms of the Administration Agreement, fourth the terms of the relevant Governing Agreement shall prevail, and fifth, the terms of the other related Program Agreements shall prevail.

ARTICLE 11:    MISCELLANEOUS
A.    Representations and Warranties.  Except as otherwise disclosed to Administrative Agent in writing, each DIP Seller hereby represents and warrants to the Administrative Agent and Buyers that it is in compliance with all the terms and provisions set forth in the DIP Warehouse Facility Agreements on its part to be observed or performed, and that no Event of Default has occurred or is continuing under any DIP Warehouse Facility Agreement, and hereby confirms and reaffirms the representations and warranties contained in Section 13 of each Repurchase Agreement.
B.    Binding Effect; Entire Agreement.  This Master Refinancing Agreement shall be binding and inure to the benefit of the parties hereto and their respective successors and permitted assigns. This Master Refinancing Agreement and the other DIP Warehouse Facility Agreements represent the entire agreement between the parties hereto with respect to the subject matter contained herein and therein. This Master Refinancing Agreement supersedes all prior agreements and understandings, oral or written, with respect to the subject matter hereof.  Except as expressly supplemented and modified by this Master Refinancing Agreement and/or the DIP Orders, the agreements, instruments and documents identified on Schedule II hereto shall continue to be, and shall remain, in full force and effect and for all purposes shall constitute Program Agreements related to the relevant Governing Agreement identified opposite the description thereof.
C.    Severability. Each provision and agreement herein shall be treated as separate and independent from any other provision or agreement herein and shall be enforceable notwithstanding the unenforceability of any such other provision or agreement.
D.    Buyers and MSFTA Counterparties May Act Through Administrative Agent.  Each Buyer and MSFTA Counterparty has designated the Administrative Agent for the purpose of performing any action hereunder (other than, for the sake of clarity, Article 8 hereof).  The exculpatory and liability-limiting provisions contained in the Administration Agreement with respect to the Administrative Agent shall also apply in all respects to the Administrative Agent hereunder and under the other DIP Warehouse Facility Agreements.
E.    Amendments.  

28
2014058.10-NYCSR07A - MSW

1.    Neither this Master Refinancing Agreement nor any term hereof may be changed, waived, discharged or terminated orally, but only by an instrument in writing signed by the Sellers, the Administrative Agent and Required Buyers.
2.    Notwithstanding anything to the contrary herein or in the other DIP Warehouse Facility Agreements, any facilities entered into for the financing of Ginnie Mae Tail HMBS are contemplated to be documented separately from the other Eligible Asset categories described in the RMS Repurchase Agreement.  RMS, the Administrative Agent and the Buyers shall work together in good faith to structure and document any facilities for Ginnie Mae Tail HMBS (the “DIP HMBS Documentation”) and shall endeavor to complete any DIP HMBS Documentation within thirty (30) days after the Effective Date.  It is understood and agreed that (i) the maximum committed amount under the DIP HMBS Documentation shall be equal to the Ginnie Mae Tail HMBS Sublimit (as defined in the RMS Repurchase Agreement), and (ii) the sum of (x) the maximum combined committed amount under the DIP HMBS Documentation and (y) the Maximum Aggregate Purchase Price under and as defined in the RMS Repurchase Agreement shall not at any time exceed the Maximum Aggregate Purchase Price under and as defined in the RMS Repurchase Agreement as in effect on the Effective Date. Any DIP HMBS Repurchase Agreement and other DIP HMBS Documentation entered into pursuant to this paragraph (x) shall constitute a DIP Warehouse Facility Agreement and a Governing Agreement, and (y) shall be subject in all respects to the terms and conditions of, among other things, the DIP Orders, this Master Refinancing Agreement and the Administration Agreement.
F.    Counterparts.  This Master Refinancing Agreement may be executed by each of the parties hereto on any number of separate counterparts, each of which shall be an original and all of which taken together shall constitute one and the same instrument.  Delivery of an executed counterpart of a signature page of this Master Refinancing Agreement in Portable Document Format (PDF) or by facsimile shall be effective as delivery of a manually executed original counterpart of this Master Refinancing Agreement.
G.    Reaffirmation of Guaranty.  The Guarantor acknowledges and agrees that the term “Obligations” as used in the DIP Guaranty shall apply to all of the Obligations (as defined therein) of DIP Sellers to Administrative Agent and Buyer Parties (as defined in the DIP Guaranty) under this Master Refinancing Agreement, the DIP Orders, the applicable Governing Agreements referred to in the DIP Guaranty, MSFTAs, and the related Program Agreements.  The Guarantor hereby ratifies and affirms all of the terms, covenants, conditions and obligations of each Limited Guaranty.
H.    Bankruptcy Non-Petition. The parties hereby agree that they shall not institute against, or join any other person in instituting against, any Buyer that is a CP Conduit any bankruptcy, reorganization, arrangement, insolvency or liquidation proceeding, or other proceeding under any federal or state bankruptcy or similar law, for one year and one day after the latest maturing commercial paper note issued by the applicable CP Conduit is paid in full.
I.    Limited Recourse. The obligations of each party under this Master Refinancing Agreement or any other Program Agreement are solely the corporate or limited liability company obligations of such party. No recourse shall be had for the payment of any amount owing by any 

29
2014058.10-NYCSR07A - MSW

party under this Master Refinancing Agreement, or for the payment by any party of any fee in respect hereof or any other obligation or claim of or against such party arising out of or based on this Master Refinancing Agreement, against any stockholder, partner, member, employee, officer, director or incorporator or other authorized person of such party. In addition, notwithstanding any other provision of this Master Refinancing Agreement, the parties hereto agree that all payment obligations of any Buyer that is a CP Conduit under this Master Refinancing Agreement shall be limited recourse obligations of such Buyer, payable solely from the funds of such Buyer available for such purpose in accordance with its commercial paper program documents. Each party waives payment of any amount which such Buyer that is a CP Conduit does not pay pursuant to the operation of the preceding sentence until the day which is at least one year and one day after the payment in full of the latest maturing commercial paper note issued in accordance with its commercial paper program documents (and waives any “claim” against such Buyer within the meaning of Section 101(5) of the Bankruptcy Code or any other Debtor Relief Law for any such insufficiency until such date).
J.    Notices. Any and all notices, statements, demands or other communications hereunder may be given by a party to the other by mail, email, messenger or otherwise to the address specified on the signature pages hereto, or so sent to such party at any other place specified in a notice of change of address hereafter received by the other. All notices, demands and requests hereunder may be made orally, to be confirmed promptly in writing, or by other communication as specified in the preceding sentence. In all cases, to the extent that the related individual set forth in the respective “Attention” line is no longer employed by the respective party hereto, such notice may be given to the attention of an officer of the respective Person or to the attention of such individual or individuals as subsequently notified in writing by an officer of the respective party.
K.    GOVERNING LAW.  THIS MASTER REFINANCING AGREEMENT SHALL BE GOVERNED BY, AND CONSTRUED IN ACCORDANCE WITH, THE LAWS OF THE STATE OF NEW YORK, WITHOUT REFERENCE TO THE CHOICE OF LAW PROVISIONS THEREOF (OTHER THAN SECTION 5-1401 OF THE NEW YORK GENERAL OBLIGATIONS LAW) AND, TO THE EXTENT APPLICABLE, THE BANKRUPTCY CODE.
L.    WAIVER OF JURY TRIAL.  EACH PARTY HERETO HEREBY WAIVES, TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW, ANY RIGHT IT MAY HAVE TO A TRIAL BY JURY IN RESPECT OF ANY LITIGATION DIRECTLY OR INDIRECTLY ARISING OUT OF, UNDER OR IN CONNECTION WITH THIS MASTER REFINANCING AGREEMENT (WHETHER BASED ON CONTRACT, TORT OR ANY OTHER THEORY). EACH PARTY HERETO (I) CERTIFIES THAT NO REPRESENTATIVE, AGENT OR ATTORNEY OF ANY OTHER PARTY HAS REPRESENTED, EXPRESSLY OR OTHERWISE, THAT SUCH OTHER PARTY WOULD NOT, IN THE EVENT OF LITIGATION, SEEK TO ENFORCE THE FOREGOING WAIVER AND (II) ACKNOWLEDGES THAT IT AND THE OTHER PARTIES HERETO HAVE BEEN INDUCED TO ENTER INTO THIS MASTER REFINANCING AGREEMENT BY, AMONG OTHER THINGS, THE MUTUAL WAIVERS AND CERTIFICATIONS IN THIS PARAGRAPH. 

30
2014058.10-NYCSR07A - MSW

M.    JURISDICTION.  EACH PARTY HERETO IRREVOCABLY AND UNCONDITIONALLY AGREES THAT IT WILL NOT COMMENCE ANY ACTION, LITIGATION OR PROCEEDING OF ANY KIND OR DESCRIPTION, WHETHER IN LAW OR EQUITY, WHETHER IN CONTRACT OR TORT OR OTHERWISE, AGAINST THE ADMINISTRATIVE AGENT, ANY OTHER SECURED PARTY OR ANY RELATED PARTY OF ANY OF THE FOREGOING, IN ANY WAY RELATING TO THIS MASTER REFINANCING AGREEMENT OR THE TRANSACTIONS RELATING HERETO, IN A FORUM OTHER THAN THE BANKRUPTCY COURT (OR, IF THE BANKRUPTCY COURT DOES NOT HAVE (OR ABSTAINS FROM) JURISDICTION, THE COURTS OF THE STATE OF NEW YORK SITTING IN NEW YORK COUNTY, AND OF THE UNITED STATES DISTRICT COURT OF THE SOUTHERN DISTRICT OF NEW YORK, AND ANY APPELLATE COURT FROM ANY THEREOF, AND EACH OF THE PARTIES HERETO IRREVOCABLY AND UNCONDITIONALLY SUBMITS TO THE JURISDICTION OF SUCH COURTS AND AGREES THAT ALL CLAIMS IN RESPECT OF ANY SUCH ACTION, LITIGATION OR PROCEEDING MAY BE HEARD AND DETERMINED IN SUCH NEW YORK STATE COURT OR, TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW, IN THE BANKRUPTCY COURT OR SUCH OTHER FEDERAL COURT.  EACH OF THE PARTIES HERETO AGREES THAT A FINAL JUDGMENT IN ANY SUCH ACTION, LITIGATION OR PROCEEDING SHALL BE CONCLUSIVE AND MAY BE ENFORCED IN OTHER JURISDICTIONS BY SUIT ON THE JUDGMENT OR IN ANY OTHER MANNER PROVIDED BY LAW.  NOTHING IN THIS MASTER REFINANCING AGREEMENT, ANY GOVERNING AGREEMENT OR IN ANY OTHER RELATED AGREEMENT SHALL AFFECT ANY RIGHT THAT THE ADMINISTRATIVE AGENT MAY OTHERWISE HAVE TO BRING ANY ACTION OR PROCEEDING RELATING TO THIS MASTER REFINANCING AGREEMENT, ANY GOVERNING AGREEMENT OR IN ANY OTHER RELATED AGREEMENT AGAINST ANY DIP SELLER, ANY AFFILIATE THEREOF OR ANY OF THEIR RESPECTIVE PROPERTIES IN THE COURTS OF ANY JURISDICTION.  Each of the parties hereto hereby irrevocably and unconditionally waives, to the fullest extent it may legally and effectively do so, any objection which it may now or hereafter have to the laying of venue of any suit, action or proceeding arising out of or relating to this Master Refinancing Agreement in the Bankruptcy Court or any such New York State or federal court referred to above. Each of the parties hereto hereby irrevocably waives, to the fullest extent permitted by law, the defense of an inconvenient forum to the maintenance of such action or proceeding in any such court. 
N.    Termination Date.  The commitments of the Secured Parties under the DIP Warehouse Facility Agreements shall automatically terminate by their own terms upon the occurrence the Termination Date.  Notwithstanding the occurrence of the Termination Date, (i) this Master Refinancing Agreement shall remain in full force and effect and (ii) the Administrative Agent and the other Secured Parties shall continue to have all of their respective rights and remedies set forth in the DIP Warehouse Facility Agreements until the Secured Obligations have been indefeasibly paid in full in cash and all the commitments of the Secured Parties under the DIP Warehouse Facility Agreements have terminated or expired.

31
2014058.10-NYCSR07A - MSW

O.    General Interpretive Principles.  For purposes of this Master Refinancing Agreement, except as otherwise expressly provided or unless the context otherwise requires:
1.the terms defined in this Master Refinancing Agreement have the meanings assigned to them in this Master Refinancing Agreement and include the plural as well as the singular, and the use of any gender herein shall be deemed to include the other gender;
2.accounting terms not otherwise defined herein have the meanings assigned to them in accordance with GAAP, and all financial computations required under this Master Refinancing Agreement shall be made, in accordance with GAAP, consistently applied;
3.references herein to “Articles”, “Sections”, “Subsections”, “Paragraphs”, and other subdivisions without reference to a document are to designated Articles, Sections, Subsections, Paragraphs and other subdivisions of this Master Refinancing Agreement;
4.a reference to a Subsection without further reference to a Section is a reference to such Subsection as contained in the same Section in which the reference appears, and this rule shall also apply to Paragraphs and other subdivisions;
5.the words “herein”, “hereof”, “hereunder” and other words of similar import refer to this Master Refinancing Agreement as a whole and not to any particular provision; 
6.the term “include” or “including” shall mean without limitation by reason of enumeration; 
7.all times specified herein or in any other DIP Warehouse Facility Agreement are local times in New York, New York unless otherwise stated; 
8.the headings in this Master Refinancing Agreement are for convenience of reference only and shall not define or limit the provisions hereof;
9.all references herein or in any other DIP Warehouse Facility Agreement to “good faith” means good faith as defined in Section 5 102(7) of the UCC as in effect in the State of New York; 
10.any definition of or reference to any agreement, instrument or other document shall be construed as referring to such agreement, instrument or other document as from time to time amended, supplemented or otherwise modified (subject to any restrictions on such amendments, supplements or modifications set forth herein or in any other  DIP Warehouse Facility Agreement); 
11.any reference to any law shall include all statutory and regulatory provisions consolidating, amending, replacing or interpreting such law and any reference to any law or regulation shall, unless otherwise specified, refer to such law or regulation as amended, modified or supplemented from time to time; and

32
2014058.10-NYCSR07A - MSW

12.any reference herein to the termination of all the commitments under the Governing Agreements or words of similar import shall refer to (i) the reduction to zero of the Maximum Available Funding for each Governing Agreement and the Maximum Combined Purchase Price and (ii) the termination of any other commitment of any Secured Party to extend credit under, or enter into transactions pursuant to, any of the DIP Warehouse Facility Agreements.
[Signature Pages Follow]

33
2014058.10-NYCSR07A - MSW

EXHIBIT 10.40

IN WITNESS WHEREOF, the undersigned have caused this Master Refinancing Agreement to be duly executed as of the date first above written.
BARCLAYS BANK PLC,  
as Administrative Agent
By    /s/ Joseph O’ Doherty            
Name: Joseph O’ Doherty
Title:   Managing Director

BARCLAYS BANK PLC,  
as a Buyer and a Committed Buyer

By    /s/ Joseph O’ Doherty            
Name: Joseph O’ Doherty
Title:   Managing Director

BARCLAYS CAPITAL INC.,  
as an MSFTA Counterparty

By    /s/ Joseph O’ Doherty            
Name: Joseph O’ Doherty
Title:   Managing Director

Signature Page to Master Refinancing Agreement

NOMURA CORPORATE FUNDING AMERICAS, LLC, as a Buyer and a Committed Buyer

By /s/ Kelvin Ji                    
Name: Kelvin Ji
Title:   Managing Director

NOMURA SECURITIES INTERNATIONAL, INC., as an MSFTA Counterparty

By    /s/ Vincent Primiano                
Name: Vincent Primiano
Title:   Managing Director

Signature Page to Master Refinancing Agreement

DITECH FINANCIAL LLC,  
as a DIP Seller
By    /s/ Joanna Colaneri                
Name: Joanna Colaneri
Title:   Senior Vice President and Treasurer

REVERSE MORTGAGE SOLUTIONS, INC.,  
as a DIP Seller

By    /s/ Andrew Dokos                
Name: Andrew Dokos
Title:   Vice President and Treasurer

RMS REO BRC II, LLC, as a DIP Seller

By    /s/ Andrew Dokos                
Name: Andrew Dokos
Title:   Vice President and Treasurer

DITECH HOLDING CORPORATION,  
as Guarantor

By    /s/ Joanna Colaneri                
Name: Joanna Colaneri
Title:   Senior Vice President and Treasurer

Signature Page to Master Refinancing Agreement

SCHEDULE I
CERTAIN CLOSING DOCUMENTS

[see attached]

Sched. I-1
2014058.10-NYCSR07A - MSW

SCHEDULE II

SPECIFIED EXISTING PROGRAM AGREEMENTS

	
		
	Ditech Repurchase Agreement:
	•    Amended and Restated Block Account Control Agreement, made and effective as of the Effective Date, among Barclays Bank PLC, as Administrative Agent, Ditech Financial LLC and U.S. Bank National Association.  

•    Amendment No. 8 to the Intercreditor Agreement, made and effective as of the Effective Date, among Credit Suisse First Boston Mortgage Capital LLC, Barclays Bank PLC and Ditech Financial LLC.

•    Amendment No. 8 to Joint Account Control Agreement, made and effective as of the Effective Date, among Deutsche Bank National Trust Company, Ditech Financial LLC, Credit Suisse First Boston Mortgage Capital LLC and Barclays Bank PLC, as Administrative Agent.  

•    Amendment No. 8 to Joint Securities Account Control Agreement, made and effective as of the Effective Date, among Deutsche Bank National Trust Company, Ditech financial LLC, Credit Suisse First Boston Mortgage Capital LLC and Barclays Bank PLC, as Administrative Agent.

Sched. II-1
2014058.10-NYCSR07A - MSW

	
		
	RMS Repurchase Agreement:
	•    Amended and Restated Reverse Master Repurchase Agreement, made and effective as of the Effective Date, among (i) Barclays Bank PLC, as Administrative Agent, Nomura Corporate Funding Americas, LLC, as a purchaser, Barclays Bank PLC, as a purchaser, Reverse Mortgage Solutions, Inc. and RMS REO BRC II, LLC. 

•    Amended and Restated Reverse Custodial Agreement, made and effective as of the Effective Date, among RMS REO BRC II, LLC, Reverse Mortgage Solutions, Inc., Deutsche Bank National Trust Company, Barclays Bank PLC, as Administrative Agent, Nomura Corporate Funding Americas, LLC, as a purchaser, and Barclays Bank PLC, as a purchaser. 

•    Amendment No. 1 to RMS REO BRC II, LLC Limited Liability Company Agreement, made and effective as of the Effective Date.

•    Amended and Restated Deposit Account Control Agreement, made and effective as of the Effective Date, among Reverse Mortgage Solutions, Inc., Barclays Bank PLC, as Administrative Agent, and Wells Fargo Bank, NA.

•    Nominee Agreement, made and effective as of May 21, 2018, among RMS REO BRC II, LLC and Reverse Mortgage Solutions, Inc.

•    Flow Assignment Agreement, made and effective as of May 21, 2018, among Reverse Mortgage Solutions, Inc., as assignor, and RMS REO BRC II, LLC, as assignee.

•    Flow Assignment Agreement, made and effective as of May 21, 2018, among RMS REO BRC II, LLC, as assignor, and Reverse Mortgage Solutions, Inc., as assignee.

	SAF Agency Indenture:
	•    Amendment No. 1 to Receivable Sales Agreement, made and effective as of the Effective Date, among Ditech Financial LLC, Ditech Agency Advance Depositor LLC and Ditech Holding Corporation.

•    Amendment No. 1 to Trust Agreement, made and effective as of the Effective Date, among Ditech Agency Advance Depositor LLC, Wilmington Trust, National Association and Ditech Financial LLC.

•    Amendment No. 1 to Amended and Restated Limited Liability Company Agreement, made and effective as of the Effective Date, among Ditech Agency Advance Depositor LLC, Ditech Financial LLC and Albert Fioravanti.

•    Amendment No. 2 to Fannie Mae Acknowledgement Agreement, made and effective as of the Effective Date, among Ditech Financial LLC, Ditech Agency Advance Depositor LLC, Ditech Agency Advance Trust, Well Fargo Bank, NA, Barclays Bank PLC, as DIP SAF Agency Agent, and Fannie Mae.

Sched. II-2
2014058.10-NYCSR07A - MSW

	
		
	SAF PLS Indenture:
	•    Amendment No. 1 to Receivable Sales Agreement, made and effective as of the Effective Date, among Ditech Financial LLC, Ditech PLS Advance Depositor LLC and Ditech Holding Corporation.

•    Amendment No. 1 to Trust Agreement, made and effective as of the Effective Date, among Ditech PLS Advance Depositor LLC, Wilmington Trust, National Association and Ditech Financial LLC.

•    Amendment No. 1 to Amended and Restated Limited Liability Company Agreement, made and effective as of the Effective Date, among Ditech PLS Advance Depositor LLC, Ditech Financial LLC and Albert Fioravanti.

Sched. II-3
2014058.10-NYCSR07A - MSW

EXHIBIT A
PREPETITION WAREHOUSE FACILITY AGREEMENTS
		
	1.
	Amended and Restated Master Repurchase Agreement, dated as of November 18, 2016, by and among Ditech Financial LLC, as seller, Credit Suisse First Boston Mortgage Capital LLC, as administrative agent, and the buyers party thereto, as amended and in effect as of the Petition Date.

		
	2.
	Master Repurchase Agreement, dated as of April 23, 2018, between Reverse Mortgage Solutions, Inc. as seller and Barclays Bank PLC, as purchaser and agent, as amended and in effect as of the Petition Date.

		
	3.
	Second Amended and Restated Master Repurchase Agreement, dated as of November 30, 2017, by and among Reverse Mortgage Solutions, Inc., as seller, the other seller parties party thereto, Credit Suisse First Boston Mortgage Capital LLC, as administrative agent, and the buyers party thereto, as amended and in effect as of the Petition Date.

		
	4.
	Series 2018-VF1 Advance Receivables Backed Notes issued pursuant to an Indenture and the supplement thereto, each dated as of February 9, 2018, among Ditech Agency Advance Trust, as issuer, Wells Fargo, as indenture agent, calculation agent, paying agent and securities intermediary, Ditech Financial LLC, as servicer and administrator, and Credit Suisse First Boston Mortgage Capital LLC, as administrative agent, as amended and in effect as of the Petition Date.

		
	5.
	Series 2018-VF1 Advance Receivables Backed Notes issued pursuant to an Indenture and the supplement thereto, each dated as of February 9, 2018, among Ditech PLS Advance Trust II, as issuer, Wells Fargo, as indenture trustee, calculation agent, paying agent and securities intermediary, Ditech Financial LLC, as servicer and administrator, and Credit Suisse First Boston Mortgage Capital LLC, as administrative agent, as amended and in effect as of the Petition Date.

Ex. A-1
2014058.10-NYCSR07A - MSW

EXHIBIT B
INTERIM DIP ORDER
[see attached]

Ex. B-1
2014058.10-NYCSR07A - MSW

Source: [{"source": "alea-institute/alea-institute/kl3m-data-edgar-agreements/train-00294-of-00352.parquet"}, [{"source": "alea-institute/alea-institute/kl3m-data-edgar-agreements/train-00294-of-00352.parquet"}]]