Exhibit 4 THIRD AMENDMENT TO AMENDED AND RESTATED CREDIT AGREEMENT Harris Trust and Savings Bank Union Bank of California, N.A. Chicago, Illinois San Francisco, California LaSalle National Bank Bank One, Arizona, N.A. Chicago, Illinois Phoenix, Arizona First Union National Bank BankBoston, N.A. Philadelphia, Pennsylvania Stamford, Connecticut Ladies and Gentlemen: Reference is hereby made to that certain Amendment and Restatement of Credit Agreement dated as of December 22, 1998, as amended (such Credit Agreement as heretofore amended being referred to herein as the "Credit Agreement") among the undersigned, EMCOR Group, Inc., a Delaware corporation, Comstock Canada Ltd., A Canadian corporation, and Drake & Scull Group Ltd. (formerly named Drake & Scull Engineering Ltd.), a United Kingdom corporation (collectively, the "Borrowers" and individually, the "Borrower"), you (the "Lenders") and Harris Trust and Savings Bank, as agent for the Lenders (the "Agent"). All defined terms used herein shall have the same meaning as in the Credit Agreement unless otherwise define herein. The Borrowers, the Agent and the Lenders wish to modify certain terms and conditions of the Credit Agreement, all on the terms and conditions set forth in this Amendment. SECTION 1. AMENDMENTS TO CREDIT AGREEMENT Upon satisfaction of all of the conditions precedent set forth in Section 3 hereof, the Credit Agreement shall be amended as follows: 1.1 The definition of "Borrowers" set forth in Section 9 of the Credit Agreement shall be amended in its entirety and as so amended shall be restated to read as follows: "Borrowers" means (a) the U.S. Borrowers, (b) the Canadian Borrowers and (c) the U.K. Borrowers, with (i) the term "Borrowers" to mean the Borrowers, collectively, and, also each individually, and (ii) all promises and covenants (including promises to pay) and representations and warranties of and by the Borrowers made in the Loan Documents or any instruments or documents delivered pursuant thereto to be and constitute the joint and several promises, covenants, representations and warranties of and by each and all of such corporations, except to the extent explicitly otherwise provided. The term "Borrower" appearing in such singular form shall be deemed a reference to any of the Borrowers unless the context in which such term is used shall otherwise require. 1.2 The definition of "Borrowing Base" set forth in Section 9 of the Credit Agreement shall be amended by adding the following sentence thereto immediately at the end thereof: Anything contained in this Agreement notwithstanding (i) in computing compliance by U.S. Borrowers with the Borrowing Base requirements set forth in this Agreement, Eligible Accounts Receivable shall only include those Eligible Accounts Receivable attributable to the U.S. Borrowers and the U.S. Subsidiaries (exclusive of Eligible Accounts Receivable of the Company used to support Credit Utilization of the Canadian Borrowers and/or the U.K. Borrowers pursuant to clause (ii) of this sentence) and (ii) for purposes of computing compliance by the Canadian Borrowers and the U.K. Borrowers with the Borrowing Base requirements set forth herein Eligible Accounts Receivable shall include only those Eligible Accounts Receivable attributable to Restricted Subsidiaries which are not U.S. Subsidiaries and Eligible Accounts Receivable of the Company, to the extent that such Eligible Accounts Receivable of the Company were not used to support Credit Utilizations by the U.S. Borrowers. Deductions to be made in computing the Borrowing Base in respect of amounts recorded for costs in excess of billings representing certain disputed items shall be taken against the allocated to the Eligible Accounts Receivable owing to the entity which has recorded such costs. 1.3 Section 9 of the Credit Agreement shall be amended by adding thereto the following new definitions in the appropriate alphabetical locations: "Canadian Borrower" means and includes Comstock Canada and such other Restricted Subsidiaries organized under the Federal laws of Canada or the laws of a Province of Canada as may from time to time be designated as such in writing by the Company and approved as such in writing by all lenders (but subject to such conditions and limitations as either the Company or the Lenders may impose). "Canadian Subsidiaries" means and includes Comstock Canada and such other Subsidiaries organized under the Federal laws of Canada or the laws of a Province of Canada. "U.K Borrowers" means and includes Drake & Scull and such other Restricted Subsidiaries organized under the laws of the United Kingdom as may from time to time be designated as such in writing by the Company and approved as such in writing by all lenders (but subject to such conditions and limitations as either the Company or the Lenders may impose). "U.K. Subsidiaries" means Drake & Scull and such other Subsidiaries organized under the laws of the United Kingdom. "U.S. Borrowers" mean the Company and such other Restricted Subsidiaries organized under the laws of the United States of America as may from time to time be designated as such in writing by the Company and approved as such in writing by all Lenders (but subject to such conditions and limitations as either the Company or Lenders may impose). "U.S. Subsidiaries" means the Subsidiaries of the Company organized under the laws of the United States of America as may from time to time be designated as such in writing by the Company and approved as such in writing by all Lenders (but subject to such conditions and limitations as either the Company or Lenders may impose). 1.4 Section 4.1 of the Credit Agreement shall be amended by adding thereto the following language immediately at the end thereof: "Notwithstanding anything to the contrary contained herein or in any other Loan Document, the Collateral (other than Collateral constituting capital stock of the Guarantors) owned by the U.K. Subsidiaries and the Canadian Subsidiaries shall secure solely the indebtedness, liabilities and obligations of the U.K. Subsidiaries and the Canadian Subsidiaries hereunder and under the other Loan Documents and not the indebtedness, liabilities and obligations of the U.S. Borrowers and the U.S. Subsidiaries hereunder and under the other Loan Documents. The portion of the capital stock of each Guarantor which is a U. K. Subsidiary or a Canadian Subsidiary constituting Collateral in excess of 65% of the total issued and outstanding capital stock of such Subsidiary (herein, the "Excess Stock Collateral") shall secure only the indebtedness liabilities and obligations of the Canadian Subsidiaries and/or U.K. Subsidiaries hereunder and under the other Loan Documents. In no event shall the Excess Stock Collateral secure the indebtedness, liabilities and obligations of the U.S. Borrowers or the U.S. Subsidiaries hereunder or under the other Loan documents. It is understood that, subject to compliance with the Borrowing Base restrictions set forth above, the Company may borrow to fund loans to Restricted Subsidiaries permitted by Section 7.12 hererof." SECTION 2. RELEASE OF GUARANTEES Notwithstanding anything contained in the Credit Agreement of the other Loan Documents to the contrary, the Guarantees executed by the Guarantors which are U.K. Subsidiaries or Canadian Subsidiaries shall in no event be deemed a guaranty of the indebtedness, liabilities and obligations of the U. S. Borrowers or the U.S. Subsidiaries under the Credit Agreement or the other Loan Documents and such Guarantees shall be deemed released as to the indebtedness, liabilities and obligations of the U.S. Borrowers of the U.S. Subsidiaries under the Credit Agreement and the other Loan Documents, but not otherwise. SECTION 3. WAIVER Section 4.1 of the Credit Agreement to the contrary notwithstanding no lien need be granted on the stock of the Canadian Subsidiaries, Drake & Scull engineering Ltd. (formerly named Drake & Scull Engineering (north) Ltd. or Drake & Scull Ltd. (formerly named Drake & Scull Engineering (South) Ltd. (collectively, "New UK Companies") until July 31, 2000, (ii) the Canadian Subsidiaries need not grant a lien on their assets unless and until the Canadian Borrowers desire to include the assets of the Canadian Subsidiaries in the Borrowing Base and (iii) the New UK Companies need not grant a lien on their assets unless and until the UK Borrowers desire to include the assets of the New UK Companies in the Borrowing Base. SECTION 4. CONDITIONS PRECEDENT The effectiveness of this Amendment is subject to the satisfaction of all of the following conditions precedent: 4.1 The Borrowers, the Agent and the Required Lenders shall have executed this Amendment (such execution may be in several counterparts and the several parties hereto may execute on separate counterparts). 4.2 A Guarantor's Consent for the benefit of the Lenders shall have been executed and delivered to the Agent, the form of which is attached hereto. 4.3 The Borrowers shall be in full compliance with all of the terms and conditions of the Loan Documents and no Default or Event of Default shall have occurred and be continuing thereunder or shall result after giving effect to this Amendment. 4.4 Legal matters incident to the execution and delivery of this Amendment shall be satisfactory to each of the Lenders and their legal counsel. SECTION 5. MISCELLANEOUS 5.1 Each of the Borrowers has heretofore executed and delivered to the Agent that certain Amended and Restated Security Agreement dated as of December 22, 1998 (the "Security Agreement") and each Borrower hereby agrees that notwithstanding the execution and delivery hereof, such Security Agreement shall be and remain in full force and effect and that any rights and remedies of the Agent thereunder, obligations of the Borrowers thereunder and any liens or security interests created or provided for thereunder shall be and remain in full force and effect, shall not be affected, impaired or discharged thereby and shall secure all of its indebtedness, obligations and liabilities to the Agent and the Lenders under the Credit Agreement as amended hereby. Nothing herein contained shall in any manner affect or impair the priority of the liens and security interests created and provided for by the Security Agreement as to the indebtedness which would be secured thereby prior to giving effect hereto. 5.2 Reference to this specific Amendment need not be made in any note, document, letter, certificate, any security agreement, or any communication issued or made pursuant to or with respect to the Credit Agreement, any reference to the Credit Agreement being sufficient to refer to the Credit Agreement as amended hereby. 5.3 This Amendment may be executed in any number of counterparts, and by the different parties on different counterparts, all of which taken together shall constitute one and the same agreement. Any of the parties hereby may execute this agreement by signing any such counterpart and each of such counterparts shall for all purposes be deemed to be an original. This agreement shall be governed by the internal laws of the State of Illinois. 5.4 Each of the Borrowers hereby agree to pay all reasonable costs and expenses, including without limitation attorneys fees, incurred by the Agent and each of the Lenders in connection with the preparation, negotiation, execution and delivery of the Amendment and the other documents contemplated hereby. (Signature pages to follow) Upon acceptance hereof by the Agent and the Lenders in the manner hereinafter set forth, this Amendment shall be a contract between us for the purposes hereinabove set forth. Dated as of _____________, 2000 EMCOR Group, Inc. By ___________________________ Its __________________________ COMSTOCK CANADA LTD. By ___________________________ Its __________________________ DRAKE & SCULL GROUP LTD. By ___________________________ Its __________________________ Accepted and agreed to as of the day and year last above written. HARRIS TRUST AND SAVINGS BANK individually and as Agent By ________________________________ Its Vice President LASALLE NATIONAL BANK By ________________________________ Its _______________________________ FIRST UNION NATIONAL BANK By _______________________________ Its ______________________________ UNION BANK OF CALIFORNIA, N.A. By _______________________________ Its ______________________________ BANK ONE, ARIZONA, N.A. By _______________________________ Its ______________________________ BANKBOSTON, N.A. By _______________________________ Its ______________________________