1 Exhibit 10.5 EXECUTION COPY THIRD AMENDMENT TO LETTER OF CREDIT AND REIMBURSEMENT AGREEMENT This THIRD AMENDMENT TO LETTER OF CREDIT AND REIMBURSEMENT AGREEMENT (this "Amendment") is dated as of November 30, 1997, and entered into by and among HUNTWAYPARTNERS,L.P., a Delaware limited partnership ("HUNTWAY"), SUNBELT REFINING COMPANY, L.P.,A Delaware limited partnership ("SUNBELT"),AND BANKERS TRUST COMPANY ("BANKERS"), and is made with reference to that certain Letter of Credit and Reimbursement Agreement dated as of June 22,1993, as amended by the First Amendment to Letter of Credit and Reimbursement Agreement dated as of December 12,1996 by and among Huntway, Sunbelt and Bankers, and the Sequencing and Amendatory Agreement defined below (as so amended, the "LETTER OF CREDIT AGREEMENT"). Capitalized terms used herein without definition shall have the same meanings herein as set forth in the Letter of Credit Agreement. PRELIMINARY STATEMENTS A. Huntway and Sunbelt have heretofore entered into that certain Sequencing and Amendatory Agreement dated as of October 31,1997 (the "Sequencing and Amendatory Agreement") with Lighthouse Investors, L.L.C.,a Delaware limited liability company, B III Capital Partners, L.P.,a Delaware limited partnership, Contrarian Capital Fund I, L.P.,a Delaware limited partnership, Contrarian Capital Fund II, L.P.,a Delaware limited partnership, Bankers, Massachusetts Mutual Life Insurance Company, Mellon Bank, N.A., as trustee for First Plaza Group Trust, Oppenheimer & Company., Inc., as agent for itself and certain affiliated entities and for itself and as Agent for certain affiliates as listed under the signature of Contrarian Capital Advisors, L.L.C. on the signature page thereof, The IBM Retirement Plan Trust, Lindner Growth Fund, Madison Dearborn Partners III and First Chicago Equity Corporation, United States Trust Company of New York, as Collateral Agent, State Street Bank & Trust Company, as trustee under the Senior Subordinated Indenture referred to therein, and Fleet National Bank, as trustee under the Collateralized Note Indenture. Pursuant to the Sequencing and Amendatory Agreement, the parties hereto amended the Letter of Credit Agreement and agreed to enter into certain other amendments to the Letter of Credit Agreement, as described in Part II of Exhibit F to the Sequencing and Amendatory Agreement. B. The parties hereto desire to amend the Letter of Credit Agreement for the purpose of (i) providing that all draws on the IDB Letter of Credit will be reimbursed by Huntway on the date such draws are honored, (ii) providing that any unreimbursed draw on the IDB Letter of Credit will result in a portion of the Senior Note (Sunbelt IDB) in the principal amount of such unreimbursed draw becoming payable on demand, (iii) providing that the Company shall permanently reduce the outstanding principal amount of the IDB Bonds and the stated amount of the IDB Letter of Credit at 2 the times and in the amounts set forth herein, (iv) revising the commission payable in respect of the IDB Letter of Credit. (v) revising certain definitions, covenants and events of default in the Letter of Credit Agreement and (vi) making other revisions as set forth herein. NOW, THEREFORE, in consideration of the premises and the agreements, provisions and covenants herein contained, the parties hereto agree as follows: Section 1. AMENDMENTS TO THE LETTER OF CREDIT AGREEMENT 1.1 AMENDMENTS TO ARTICLE I: DEFINITIONS A. Section 1.01 of the Letter of Credit Agreement is hereby amended by deleting the definitions of "Commitment Termination Date" and "Senior Notes (Sunbelt IDB)" therefrom in their entirety and substituting the following therefor: "COMMITMENT TERMINATION DATE" means (i) with respect to the IDB Letter of Credit, requests to extend or renew the IDB Letter of Credit and fees payable with respect thereto, December 31, 2005 and (ii) with respect to Letters of Credit, requests to issue, extend or renew Letters of Credit and fees payable with respect thereto, December 31, 1998. "SENIOR NOTES (SUNBELT IDB)" means those certain Variable Rate Senior Secured Notes (Sunbelt IDB) due 2005 issued by Huntway pursuant to the Collateralized Note Indenture, as amended by the First Supplemental Indenture thereto dated as of October 31, 1997 and Second Supplemental Indenture thereto dated as of November 30, 1997 in the original aggregate principal amount of $9,100,000, and any notes issued in lieu thereof, or in exchange therefor, as such notes may be amended, restated or otherwise modified from time to time. B. Section 1.01 of the Letter of Credit Agreement is hereby further amended by adding the following definition thereto, which shall be inserted in proper alphabetical order: "EXCESS CASH FLOW" means, for any period, the sum of (i) Consolidated NET INCOME for such period, plus (ii) to the extent such Consolidated Net Income has been reduced thereby, amortization expense, depreciation expense, interest not paid in cash, and other non-cash expenses for such period, minus the sum of (a) the aggregate amount of principal paid in cash during such period (b) Consolidated Capital Expenditures made during such period that were permitted under the Collateralized Note Indenture. As used in this definition, the terms "Consolidated Net Income" and "Consolidated Capital Expenditures" have the 2 3 meanings assigned to thereto in the Collateralized Note Indenture' as in effect on November 1, 1997." 1.2 AMENDMENTS TO ARTICLE II: AMOUNT AND TERMS OF LETTERS OF CREDIT A. Section 2.01B(ii) of the Letter of Credit Agreement is hereby amended by deleting it in its entirety and substituting the following therefor "(ii) Bankers agrees to extend the Stated Termination Date of the IDB Letter of Credit from time to time from the Effective Date to and excluding the Commitment Termination Date in accordance with the terms thereof and hereof (the 'IDB Commitment'); provided that in no event shall Bankers amend the IDB Letter of Credit in a manner that would result in the IDB Letter of Credit having (x) a Stated Termination Date later than the Commitment Termination Date or (y) a Stated Termination Date more than 9 months after the date of its most recent amendment. The IDB Letter of Credit shall not be included within the deemed term 'Letter of Credit' and the amount available for drawing thereunder shall not be included in determining usage or availability of the Letter of Credit Amount. Sunbelt's obligation to reimburse Bankers for any drawing under the IDB Letter of Credit has been assumed by Huntway pursuant to the Huntway Assumption Agreement and is evidenced in part by the Senior Note (Sunbelt IDB) and in part hereby and constitutes part of the Obligations hereunder. Bankers agrees to surrender the Senior Note (Sunbelt IDB) for cancellation in accordance with the provisions of the Collateralized Note Indenture upon the expiration of the IDB Letter of Credit and reimbursement of all drawings made thereunder and payment of all interest thereon and other amounts owed with respect thereto." B. Section 2.02(ii) of the Letter of Credit Agreement is hereby amended by deleting it in its entirety and substituting the following therefor: "(ii) Huntway hereby agrees to pay to Bankers on the date that any drawing (including any Principal Drawings and any Interest Drawings) is honored under the IDB Letter of Credit, a sum equal to the amount of such drawing. If Huntway shall fail to reimburse Bankers in full on the day that any drawing on the IDB Letter of Credit is honored in accordance with the immediately preceding sentence, then, without limiting Bankers' rights under Section 6 hereof, in accordance with the Collateralized Note Indenture, an aggregate principal amount of the Senior Notes (Sunbelt IDB) in an amount equal to the amount of such drawing shall immediately and without further action become payable on demand by the respective holders of such Senior Note (Sunbelt IDB). The amount of all obligations under the Senior Notes (Sunbelt IDB) that shall become payable on demand pursuant to this subsection and the Collateralized Note Indenture shall be 3 4 allocated among the Senior Notes (Sunbelt IDB) in accordance with the provisions of the Collateralized Note Indenture." C. Section 2.03 of the Letter of Credit Agreement is hereby amended by adding thereto a new clause (d) as follows: (d) Huntway hereby agrees to pay to Bankers with respect to the IDB Letter of Credit a commission equal to the undrawn face amount of the IDB Letter of Credit multiplied by (i) 2.33% per annum during the period from November 1, 1997 to December 31, 1997, (ii) 2.50% per annum during the period from January 1, 1998 to June 30, 1998, (iii) 3.00% per annum from July 1, 1998 to December 31, 1998, and (iv) 2.33% per annum thereafter. Such commissions shall be calculated on the basis of a 360-day year for the actual number of days elapsed and shall be payable monthly in arrears on the thirtieth day of each month commencing on February 28, 1998, and at maturity." 1.4 AMENDMENTS TO ARTICLE V: COVENANTS A. Section 5.01(d) of the Letter of Credit Agreement is hereby amended by deleting it in its entirety and substituting the following therefor: "(d) Promptly after each payment by Huntway in respect of the principal amount of Senior Notes (Sunbelt IDB) pursuant to Section 3.07(d) of the Collateralized Note Indenture, Sunbelt will direct the trustee under the IDB Indenture to redeem IDB Bonds in an aggregate principal amount equal to the amount of such payment. Any redemptions of the IDB Bonds pursuant to this Section 5.01(d) shall be applied to reduce the scheduled redemptions of IDB Bonds set forth in Section 5.01(f) in inverse order of maturity. Huntway shall cause each redemption of the IDB Bonds made pursuant to this Section 5.01(d) to result in a permanent reduction in the stated amount of the IDB Letter of Credit in the amount of the aggregate principal amount of the IDB Bonds so redeemed. Any principal payments received by Bankers pursuant to Section 3.07(d) of the Collateralized Note Indenture shall be applied against Huntway's obligations arising under Section 2.02(ii) hereof as a result of such redemption of IDB Bonds." B. Section 5.01 of the Letter of Credit Agreement is hereby amended by adding thereto new clauses (f) and (g) as follows: "(f) Scheduled Redemptions of IDB Bonds. Huntway shall cause IDB Bonds to be permanently redeemed in installments on the dates and in the amounts set forth below: Date Scheduled Redemption of Bonds ---- ----------------------------- September 30, 2001 $400,000 4 5 December 31, 2001 $ 600,000 September 30, 2002 $ 400,000 December 31, 2002 $ 600,000 September 30, 2003 $ 400,000 December 31, 2003 $ 600,000 September 30, 2004 $ 400,000 December 31, 2004 $ 600,000 September 30, 2005 $ 400,000 December 31, 2005 $4,200,000 ; provided that the scheduled redemptions of the IDB Bonds set forth above shall be reduced in connection with any mandatory redemptions of the IDB Bonds in accordance with Section 5.01(d) or 5.01(g); provided further that all outstanding IDB Bonds shall be redeemed and all interest and other obligations with respect thereto paid not later than December 31, 200s,and the final installment payable by Huntway in respect of the IDB Bonds on such date shall be in an amount, if different from that specified above, sufficient to repay all amounts owing with respect to the IDB Bonds. Huntway shall cause each redemption of the IDB Bonds made pursuant to this Section 5.01(f) to result in a permanent reduction in the stated amount of the IDB Letter of Credit in the amount of the aggregate principal amount of the IDB Bonds so redeemed. (g) Mandatory Redemptions from Excess Cash Flow. Not later than 90 days after the end of each of 1999 and 2000, Huntway shall cause IDB Bonds to be permanently redeemed in an aggregate principal amount equal to the lesser of (x) 66.67% of Excess Cash Flow for such calendar year and (y) $1,000,000. Any redemptions of the IDB Bonds pursuant to this Section 5.01(g) shall be applied to reduce the scheduled redemptions of IDB Bonds set forth in Section 5.01(fl in inverse order of maturity. Huntway shall cause each redemption of the IDB Bonds made pursuant to this Section 5.01(g) to result in a permanent reduction in the stated amount of the IDB Letter of Credit in the amount of the aggregate principal amount of the IDB Bonds so redeemed." 1.5 AMENDMENTS TO ARTICLE VI: EVENTS OF DEFAULT. A. Section 6.02 of the Letter of Credit Agreement is hereby amended by deleting it in its entirety and substituting the following therefor: "SECTION 6.02. UPON AN EVENT OF DEFAULT. (a) If an Event of Default described under Section 6.01(viii) or 6.01(ix) occurs, any and all Obligations (i) then owing or (ii) which would become owing upon a drawing of any amount available under any Letter of Credit or the IDB Letter of Credit shall automatically become due and payable, all obligations under the Senior Notes (Sunbelt IDB) shall automatically become due and payable, and 5 6 the Commitment shall automatically terminate Any amounts described in clause (ii) above when received by Bankers shall be delivered to the Collateral Agent pursuant to the Collateral Account Agreement as cash collateral for the Obligations and for the Senior Notes and Convertible Notes, as required by the Intercreditor Agreement. (b) If any Event of Default shall have occurred and be continuing (including under Section 6.01(viii) or 6.01(ix) with respect to clause (iii) below), Bankers may, in its sole discretion, but shall not be obligated to, (i) by notice to Huntway and Sunbelt, declare the Commitment to be terminated, whereupon the same shall forthwith terminate, (ii) declare any and all Obligations (x) then owing and (y) which would become owing upon a drawing of any amount available under any Letter of Credit or the IDB Letter of Credit to be immediately due and payable, whereupon all obligations described in the preceding clauses (x) and (y) shall automatically become due and payable and all obligations under the Senior Notes (Sunbelt IDB) shall automatically become due and payable, or (iii) exercise any other remedy available to it at law, in equity or otherwise. Any amounts described in clause (y) above when received by Bankers shall be delivered to the Collateral Agent pursuant to the Collateral Account Agreement as cash collateral for the Obligations and for the Senior Notes and Convertible Notes, as required by the Intercreditor Agreement." SECTION 2. CONDITIONS TO EFFECTIVENESS Section 1 of this Amendment shall become effective only upon the satisfaction of the following condition precedent (the date of satisfaction of such condition(s) being referred to herein as the "THIRD AMENDMENT EFFECTIVE DATE"): A. On or before the Third Amendment Effective Date, the Second Supplemental Indenture dated as of November 30, 1997, by and between Huntway and Fleet National Bank, as Indenture Trustee shall have been executed and delivered and the New Senior Notes (Sunbelt IDB), as deemed therein, shall have been authenticated, executed and delivered, and all unpaid interest on the Existing Senior Notes (Sunbelt IDB) (as defined therein) shall have been paid, and all other obligations set forth in Section 18 of such Second Supplemental Indenture shall have been performed. SECTION 3. MISCELLANEOUS A. REFERENCE TO AND EFFECT ON THE LETTER OF CREDIT AGREEMENT AND MODIFIED DOCUMENTS. (i) On and after the Third Amendment Effective Date, each reference in the Letter of Credit Agreement to "this Agreement", "hereunder", "hereof", 6 7 "herein" or words of like import referring to the Letter of Credit Agreement, and each reference in the Restructured Documents (as defined on the Intercreditor Agreement) to the "Letter of Credit Agreement" "thereunder", "thereof" or words of like import referring to the Letter of Credit Agreement shall mean and be a reference to the Letter of Credit Agreement as amended by this Amendment (the "Amended Agreement") (ii) Except as specifically amended by this Amendment, the Letter of Credit Agreement shall remain in full force and effect and is hereby ratified and confirmed. B. HEADINGS. Section and subsection headings in this Amendment are included herein for convenience of reference only and shall not constitute a part of this Amendment for any other purpose or be given any substantive effect. C. APPLICABLE LAW. THIS AMENDMENT AND THE RIGHTS AND OBLIGATIONS OF THE PARTIES HEREUNDER SHALL BE GOVERNED BY, AND SHALL BE CONSTRUED AND ENFORCED IN ACCORDANCE WITH, THE INTERNAL LAWS OF THE STATE OF NEW YORK (INCLUDING WITHOUT LIMITATION SECTION 5-1401 OF THE GENERAL OBLIGATIONS LAW OF THE STATE OF NEW YORK) WITHOUT REGARD TO CONFLICTS -OF LAWS PRINCIPLES. D. WAIVER OF JURY TRIAL. EACH PARTY HERETO HEREBY AGREES TO WAIVE ITS RESPECTIVE RIGHT TO A JURY TRIAL OF ANY CLAIM OR CAUSE OR ACTION BASED UPON OR ARISING OUT OF THIS AMENDMENT OR ANY DEALINGS BETWEEN OR AMONG THEM RELATING TO THE SUBJECT MATTER OF THE TRANSACTION CONTEMPLATED HEREBY AND THE RELATIONSHIP BEING ESTABLISHED. The scope of this waiver is intended to be all-encompassing of any and all disputes that may be filed in any court that relate to the subject matter of the transactions contemplated hereby, including, without limitation, contract claims, tort claims, breach of duty claims and all other common law and statutory claims Each party hereto acknowledges that this waiver is a material inducement to enter into a business relationship, that each has already relied on the waiver in entering into this Amendment and that each will continue to rely on the waiver in their related future dealings Each party hereto further warrants and represents that each has reviewed this waiver with its legal counsel, and that each knowingly and voluntarily waives its jury trial rights following consultation with legal counsel. THIS WAIVER IS IRREVOCABLE, MEANING THAT IT MAY NOT BE MODIFIED EITHER ORALLY OR IN WRITING, AND THIS WAIVER SHALL APPLY TO ANY SUBSEQUENT AMENDMENTS, AMENDMENTS AND RESTATEMENTS, RENEWALS, SUPPLEMENTS OR MODIFICATIONS TO THIS AMENDMENT OR TO ANY OTHER DOCUMENTS OR AGREEMENTS RELATING TO EXTENSIONS OF CREDIT PURSUANT TO THIS AGREEMENT. In the event of litigation, this Agreement may be filed as a written consent to a trial by the court. 7 8 E. COUNTERPARTS. This Amendment may be executed in any number of counterparts and by different parties hereto in separate counterparts, each of which when so executed and delivered shall be deemed an original, but all such counterparts together shall constitute but one and the same instrument; signature pages may be detached from multiple separate counterparts and attached to a single counterpart so that all signature pages are physically attached to the same document. This Amendment (other than the provisions of Section 1 hereof, the effectiveness of which is governed by Section 2 hereof) shall become effective upon the execution of a counterpart hereof by each of the parties hereto and receipt by each of the parties hereto of written or telephonic notification of such execution and authorization of delivery thereof. On the Third Amendment Effective Note, the obligation of the parties hereto to amend the Letter of Credit Agreement pursuant to the Sequencing and Amendatory Agreement shall be terminated. [Remainder of page intentionally left blank] 8 9 Page S-1 to Third Amendment to Letter of Credit Agreement IN WITNESS WHEREOF, the parties hereto have caused this Amendment to be duly executed and delivered by their respective officers "hereunto duly authorized as of the date first written above. BANKERS TRUST COMPANY By: ----------------------------------------------- Title: HUNTWAY PARTNERS, L.P. By: HUNTWAY MANAGING PARTNER, L.P., its Managing General Partner By: The Huntway Division of Reprise Holdings, Inc., its sole General Partner By: -------------------------------------- Title: By: HUNTWAY HOLDINGS, L.P.,its Special General Partner By: The Huntway Division of Reprise Holdings, Inc., its sole General Partner By: -------------------------------------- Title: SUNBELT REFINING COMPANY, L.P. By: HUNTWAY PARTNERS, L.P.,its sole General partner By: The Huntway Division of Reprise Holdings, Inc., its sole General Partner By: -------------------------------------- Title: S-1