Summary of Significant Accounting Policies | SUMMARY OF SIGNIFICANT ACCOUNTING POLICIES Principles of Consolidation The accompanying condensed consolidated financial statements include the accounts of the Company, its subsidiaries in which the Company has a controlling financial interest and investment funds formed to fund the purchase of solar energy systems, which are consolidated as variable interest entities (“VIE”). The Company uses a qualitative approach in assessing the consolidation requirement for VIEs. This approach focuses on determining whether the Company has the power to direct the activities of the VIE that most significantly affect the VIE’s economic performance and whether the Company has the obligation to absorb losses or the right to receive benefits that could potentially be significant to the VIE. For all periods presented, the Company has determined that it is the primary beneficiary in all of its operational VIEs. The Company evaluates its relationships with the VIEs on an ongoing basis to ensure that it continues to be the primary beneficiary. All significant intercompany accounts and transactions have been eliminated. Gains and losses from the translation of all foreign currency financial statements are recorded in accumulated other comprehensive loss, net, within stockholders’ equity. The Company prepares its financial statements in conformity with GAAP. Use of Estimates GAAP requires management to make estimates and assumptions that affect the reported amounts of assets and liabilities, the disclosure of contingent assets and liabilities at the date of the financial statements and the reported amounts of revenue and expenses during the reporting period. The most significant estimates and assumptions used in these condensed consolidated financial statements relate to management’s estimates of final construction contract profit in accordance with accounting for long-term contracts, allowance for doubtful accounts, inventory reserves, realization of project development costs, fair value of derivative financial instruments, accounting for business acquisitions, stock-based awards, impairment of long-lived assets, income taxes, self insurance reserves and potential liability in conjunction with certain commitments and contingencies. Actual results could differ from those estimates. The Company is self-insured for employee health insurance. The maximum exposure in fiscal year 2017 under the plan is $100 per covered participant, after which reinsurance takes effect. The liability for unpaid claims and associated expenses, including incurred but not reported claims, is determined by management and reflected in the Company’s consolidated balance sheets in accrued expenses and other current liabilities. The liability is calculated based on historical data, which considers both the frequency and settlement amount of claims. The Company’s estimated accrual for this liability could be different than its ultimate obligation if variables such as the frequency or amount of future claims differ significantly from management’s assumptions. Cash and Cash Equivalents Cash and cash equivalents includes cash on deposit, overnight repurchase agreements and amounts invested in highly liquid money market funds. Cash equivalents consist of short term investments with original maturities of three months or less. The Company maintains accounts with financial institutions and the balances in such accounts, at times, exceed federally insured limits. This credit risk is divided among a number of financial institutions that management believes to be of high quality. The carrying amount of cash and cash equivalents approximates its fair value measured using level 1 inputs per the fair value hierarchy as defined in Note 7. Restricted Cash Restricted cash consists of cash and cash equivalents held in an escrow account in association with construction draws for energy savings performance contracts (“ESPC”), construction of energy assets, operations and maintenance (“O&M”) reserve accounts and cash collateralized letters of credit as well as cash required under term loans to be maintained in debt service reserve accounts until all obligations have been indefeasibly paid in full. These accounts are primarily invested in highly liquid money market funds. The carrying amount of the cash and cash equivalents in these accounts approximates its fair value measured using level 1 inputs per the fair value hierarchy as defined in Note 7. Restricted cash also includes funds held for clients, which represent assets that, based upon the Company’s intent, are restricted for use solely for the purposes of satisfying the obligations to remit funds to third parties, primarily utility service providers, relating to the Company’s enterprise energy management services. As of September 30, 2017 and December 31, 2016 , the Company classified the non-current portion of restricted cash of $19,396 and $19,920 , respectively, in other assets on its consolidated balance sheets. Accounts Receivable Accounts receivable are stated at the amount management expects to collect from outstanding balances. An allowance for doubtful accounts is provided for those accounts receivable considered to be uncollectible based upon historical experience and management’s evaluation of outstanding accounts receivable. Bad debts are written off against the allowance when identified. Changes in the allowance for doubtful accounts are as follows: Nine Months Ended September 30, 2017 2016 Allowance for doubtful accounts, beginning of period $ 7,836 $ 3,729 Charges to costs and expenses 68 4,057 Account write-offs and other (4,088 ) 195 Allowance for doubtful accounts, end of period $ 3,816 $ 7,981 During the three months ended March 31, 2016, the Company reserved for certain assets related to a customer who declared bankruptcy. A portion of this amount, $200 was recorded as an allowance for doubtful accounts in accounts receivable, net. In addition, the Company recorded a $476 charge to write-off costs and estimated earnings in excess of billings and a $325 charge for project costs incurred. During the three months ended September 30, 2016, the Company reserved for an additional $2,194 as an allowance for doubtful accounts in accounts receivable, net, related to the customer who declared bankruptcy. During the three months ended June 30, 2017, a settlement was reached with the customer who declared bankruptcy, and the Company has no additional exposure for the remaining receivables. During the three months ended June 30, 2016, the Company also reserved for certain assets in its Canada segment totaling $1,934 due to collectability concerns as a result of its previously disclosed restructuring efforts. This reserve included $1,655 for doubtful accounts in accounts receivable, net and $279 reserved against accounts receivable retainage, net. Accounts Receivable Retainage Accounts receivable retainage represents amounts due from customers, but where payments are withheld contractually until certain construction milestones are met. Amounts retained typically range from 5% to 10% of the total invoice. The Company classifies as a current asset those retainages that are expected to be billed in the next twelve months. As of September 30, 2017 and December 31, 2016 , $422 and $887 , respectively, was recorded by the Company as a reserve for accounts receivable retainage for amounts determined to be potentially uncollectible. Inventory Inventories, which consist primarily of PV solar panels, batteries and related accessories, are stated at the lower of cost (“first-in, first-out” method) or net realizable value (determined as the estimated selling prices in the ordinary course of business, less reasonably predictable costs of completion, disposal, and transportation). Provisions have been made to reduce the carrying value of inventory to the net realizable value. Prepaid Expenses Prepaid expenses consist primarily of short-term prepaid expenditures that will amortize within one year. Federal ESPC Receivable Federal ESPC receivable represents the amount to be paid by various federal government agencies for work performed and earned by the Company under specific ESPCs. The Company assigns certain of its rights to receive those payments to third-party investors that provide construction and permanent financing for such contracts. Upon completion and acceptance of the project by the government, typically within 24 months of construction commencement, the assigned ESPC receivable from the government and corresponding ESPC liability are eliminated from the Company’s condensed consolidated financial statements. Project Development Costs The Company capitalizes as project development costs only those costs incurred in connection with the development of energy projects, primarily direct labor, interest costs, outside contractor services, consulting fees, legal fees and travel, if incurred after a point in time where the realization of related revenue becomes probable. Project development costs incurred prior to the probable realization of revenue are expensed as incurred. The Company classifies as a current asset those project development efforts that are expected to proceed to construction activity in the twelve months that follow. The Company periodically reviews these balances and writes off any amounts where the realization of the related revenue is no longer probable. Property and Equipment Property and equipment consists primarily of office and computer equipment, and is recorded at cost. Major additions and improvements are capitalized as additions to the property and equipment accounts, while replacements, maintenance and repairs that do not improve or extend the life of the respective assets are expensed as incurred. Depreciation and amortization of property and equipment are computed on a straight-line basis over the following estimated useful lives: Asset Classification Estimated Useful Life Furniture and office equipment Five years Computer equipment and software costs Three to five years Leasehold improvements Lesser of term of lease or five years Automobiles Five years Land Unlimited Energy Assets Energy assets consist of costs of materials, direct labor, interest costs, outside contract services and project development costs incurred in connection with the construction of small-scale renewable energy plants that the Company owns. These amounts are capitalized and amortized to cost of revenues in the Company’s consolidated statements of income on a straight line basis over the lives of the related assets or the terms of the related contracts. The Company capitalizes interest costs relating to construction financing during the period of construction. Capitalized interest is included in energy assets, net in the Company’s consolidated balance sheets. Capitalized interest is amortized to cost of revenues in the Company’s consolidated statements of income on a straight line basis over the useful life of the associated energy asset. There was $925 and $289 in interest capitalized for the three months ended September 30, 2017 and 2016 , respectively. There was $3,452 and $616 in interest capitalized for the nine months ended September 30, 2017 and 2016 , respectively. Routine maintenance costs are expensed in the current year’s consolidated statements of income to the extent that they do not extend the life of the asset. Major maintenance, upgrades and overhauls are required for certain components of the Company’s assets. In these instances, the costs associated with these upgrades are capitalized and are depreciated over the shorter of the remaining life of the asset or the period until the next required major maintenance or overhaul. Gains or losses on disposal of property and equipment are reflected in selling, general and administrative expenses in the consolidated statements of income. Included in energy assets are capital lease assets and accumulated depreciation of capital lease assets. Capital lease assets consist of the following: As of September 30, As of December 31, 2017 2016 Capital lease assets $ 30,430 $ 15,640 Less - accumulated depreciation and amortization (1,630 ) (744 ) Capital lease assets, net $ 28,800 $ 14,896 The Company evaluates its long-lived assets for impairment as events or changes in circumstances indicate the carrying value of these assets may not be fully recoverable. Examples of such triggering events applicable to the Company’s assets include a significant decrease in the market price of a long-lived asset or asset group or a current-period operating or cash flow loss combined with a history of operating or cash flow losses or a projection or forecast that demonstrates continuing losses associated with the use of a long-lived asset or asset group. The Company evaluates recoverability of long-lived assets to be held and used by estimating the undiscounted future cash flows before interest associated with the expected uses and eventual disposition of those assets. When these comparisons indicate that the carrying value of those assets is greater than the undiscounted cash flows, the Company recognizes an impairment loss for the amount that the carrying value exceeds the fair value. From time to time, the Company has applied for and received cash grant awards from the U.S. Treasury Department (the “Treasury”) under Section 1603 of the American Recovery and Reinvestment Act of 2009 (the “Act”). The Act authorized the Treasury to make payments to eligible persons who place in service qualifying renewable energy projects. The grants are paid in lieu of investment tax credits. All of the cash proceeds from the grants were used and recorded as a reduction in the cost basis of the applicable energy assets. If the Company disposes of the property, or the property ceases to qualify as specified energy property, within five years from the date the property is placed in service, then a prorated portion of the Section 1603 payment must be repaid. The Company did not receive any Section 1603 grants during the nine months ended September 30, 2017 or September 30, 2016 . No further Section 1603 grant payments are expected to be received as the program has expired. For tax purposes, the Section 1603 payments are not included in federal and certain state taxable income and the basis of the property is reduced by 50% of the payment received. Deferred grant income of $7,326 and $7,739 recorded in the accompanying consolidated balance sheets as of September 30, 2017 and December 31, 2016 , respectively, represents the benefit of the basis difference to be amortized to income tax expense over the life of the related property. Deferred Financing Fees Deferred financing fees relate to the external costs incurred to obtain financing for the Company. Deferred financing fees are amortized over the respective term of the financing using the effective interest method, with the exception of the Company’s revolving credit facility and construction loans, as discussed in Note 12, for which deferred financing fees are amortized on a straight-line basis over the term of the agreement. Deferred financing fees are presented on the consolidated balance sheets as a reduction to long-term debt and capital lease liabilities. Goodwill and Intangible Assets The Company has classified as goodwill the amounts paid in excess of fair value of the net assets (including tax attributes) of companies acquired in purchase transactions. The Company has recorded intangible assets related to customer contracts, customer relationships, non-compete agreements, trade names and technology, each with defined useful lives. The Company assesses the impairment of goodwill on an annual basis (December 31 st ) and whenever events or changes in circumstances indicate that the carrying value of the asset may not be recoverable. The Company would record an impairment charge if such an assessment were to indicate that the fair value of such assets was less than their carrying values. Judgment is required in determining whether an event has occurred that may impair the value of goodwill or identifiable intangible assets. Factors that could indicate that an impairment may exist include significant under-performance relative to plan or long-term projections, significant changes in business strategy, significant negative industry or economic trends or a significant decline in the base price of the Company’s publicly traded stock for a sustained period of time. Although the Company believes goodwill and intangible assets are appropriately stated in the accompanying condensed consolidated financial statements, changes in strategy or market conditions could significantly impact these judgments and require an adjustment to the recorded balance. Acquired intangible assets other than goodwill that are subject to amortization include customer contracts and customer relationships, as well as software/technology, trade names and non-compete agreements. The intangible assets are amortized over periods ranging from one to fifteen years from their respective acquisition dates. See Note 4 for additional disclosures. Other Assets Other assets consist primarily of notes and contracts receivable due to the Company from various customers and non-current restricted cash. Other assets also include the non-current portion of project development costs, accounts receivable retainages, sale-leaseback deferred loss and deferred contract costs. Other assets also include the fair value of derivatives. Asset Retirement Obligations The Company recognizes a liability for the fair value of required asset retirement obligations (“AROs”) when such obligations are incurred. The liability is estimated based on a number of assumptions requiring management’s judgment, including equipment removal costs, site restoration costs, salvage costs, cost inflation rates and discount rates and is credited to its projected future value over time. The capitalized asset is depreciated using the convention of depreciation of plant assets. Upon satisfaction of the ARO conditions, any difference between the recorded ARO liability and the actual retirement cost incurred is recognized as an operating gain or loss in the consolidated statements of income. As of September 30, 2017 and December 31, 2016 , the Company had no ARO liabilities recorded. Federal ESPC Liabilities Federal ESPC liabilities represent the advances received from third-party investors under agreements to finance certain energy savings performance contract projects with various federal government agencies. Upon completion and acceptance of the project by the government, typically within 24 months of construction commencement, the ESPC receivable from the government and corresponding ESPC liability is eliminated from the Company’s consolidated balance sheets. Until recourse to the Company ceases for the ESPC receivables transferred to the investor, upon final acceptance of the work by the government customer, the Company remains the primary obligor for financing received. Sale-Leaseback During the first quarter of 2015, the Company entered into an agreement with an investor which gives the Company the option to sell and contemporaneously lease back solar photovoltaic (“solar PV”) projects. In September 2016, the Company amended its agreement with the investor to provide for a maximum combined funding amount of $100,000 through June 30, 2017 on certain projects. In May 2017, the Company amended its agreement with the investor to extend the end date of the agreement to June 30, 2018. Additionally, the Company sold and contemporaneously leased back one solar PV project to a separate investor, not a party to the master lease agreement, under a new agreement during the three months ended March 31, 2017. See below for a summary of solar PV project sales by fiscal quarter under our sale-leaseback agreements: Quarter Ended # Solar PV Projects Sold Sale Price Deferred Gain Recorded Deferred Loss Recorded Capital Lease Asset/Liability Recorded Initial Lease Term Periodic Minimum Lease Payment Periodic Maximum Lease Payment September 30, 2016 1 6,037 333 — 3,158 25 2 397 September 30, 2017 3 9,157 642 — 4,114 20 13 231 Certain lease agreements the Company is party to provide for the sale of solar PV projects to third-party investors and the simultaneous leaseback of the projects, which the Company then operates and maintains, recognizing revenue through the sale of the electricity and solar renewable energy credits (“SRECs”) generated by these projects. In sale-leaseback arrangements, the Company first determines whether the solar PV project under the sale-leaseback arrangement is “integral equipment.” A solar PV project is determined to be integral equipment when the cost to remove the project from its existing location, including the shipping and reinstallation costs of the solar PV project at the new site, including any diminution in fair value, exceeds 10% of the fair value of the solar PV project at the time of its original installation. When the leaseback arrangement expires, the Company has the option to purchase the solar PV project for the then fair market value or, in certain circumstances, renew the lease for an extended term. All solar PV projects sold to date under such agreements have been determined by the Company not to be integral equipment as the cost to remove the project from its existing location would not exceed 10% of its original fair value. For solar PV projects that the Company has determined not to be integral equipment, the Company then determines if the leaseback should be classified as a capital lease or an operating lease. All solar PV projects sold to date under such agreements have been determined by the Company to be capital leases. For leasebacks classified as capital leases, the Company initially records a capital lease asset and capital lease obligation in its consolidated balance sheets equal to the lower of the present value of the Company’s future minimum leaseback payments or the fair value of the solar PV project. For capital leasebacks, the Company defers any gain or loss, representing the excess or shortfall of cash received from the investor compared to the net book value of the asset in the Company’s consolidated balance sheet at the time of the sale. The Company records the long term portion of any deferred gain or loss in other liabilities and other assets, respectively, and the current portion of any deferred gain and loss in accrued expenses and other current liabilities and prepaid expenses and other current assets, respectively, in its consolidated balance sheets and amortizes the deferred amounts over the lease term in cost of revenues in its consolidated statements of income. Amortization expense in cost of revenues related to deferred gains, net was $(25) and $(6) for the three months ended September 30, 2017 and 2016 , respectively. Amortization expense in cost of revenues related to deferred gains, net was $(49) and $(37) for the nine months ended September 30, 2017 and 2016 , respectively. A summary of amounts related to sale leasebacks in the Company’s consolidated balance sheets is as follows: September 30, December 31, 2017 2016 Capital lease assets, net $ 28,800 $ 14,896 Deferred loss, short-term, net 109 53 Deferred loss, long-term, net 1,943 956 Capital lease liabilities, short-term 3,451 2,185 Capital lease liabilities, long-term 24,857 12,462 Deferred gain, short-term, net 195 89 Deferred gain, long-term, net $ 3,195 $ 1,632 Other Liabilities Other liabilities consist primarily of deferred revenue related to multi-year operation and maintenance contracts which expire at various dates through 2033 . Other liabilities also include the fair value of derivatives and the long term portion of sale-leaseback deferred gains. S ee Note 8 for additional disclosures. Revenue Recognition The Company derives revenues from energy efficiency and renewable energy products and services. Energy efficiency products and services include the design, engineering, and installation of equipment and other measures to improve the efficiency, and control the operation, of a facility’s energy infrastructure. Renewable energy products and services include the construction of small-scale plants that produce electricity, gas, heat or cooling from renewable sources of energy, the sale of such electricity, gas, heat or cooling from plants that the Company owns, and the sale and installation of solar energy products and systems. Revenue from the installation or construction of projects is recognized on a percentage-of-completion basis. The percentage-of-completion for each project is determined on an actual cost-to-estimated final cost basis. Maintenance revenue is recognized as related services are performed. In accordance with industry practice, the Company includes in current assets and liabilities the amounts of receivables related to construction projects realizable and payable over a period in excess of one year. The revenue associated with contract change orders is recognized only when the authorization for the change order has been properly executed and the work has been performed. When the estimate on a contract indicates a loss, or claims against costs incurred reduce the likelihood of recoverability of such costs, the Company records the entire expected loss immediately, regardless of the percentage-of-completion. Billings in excess of cost and estimated earnings represents advanced billings on certain construction contracts. Costs and estimated earnings in excess of billings represent certain amounts under customer contracts that were earned and billable but not invoiced. The Company sells certain products and services in bundled arrangements, where multiple products and/or services are involved. The Company divides bundled arrangements into separate deliverables and revenue is allocated to each deliverable based on the relative selling price. The relative selling price is determined using third-party evidence or management’s best estimate of selling price. The Company recognizes revenue from the sale and delivery of products, including the output from renewable energy plants, when produced and delivered to the customer, in accordance with specific contract terms, provided that persuasive evidence of an arrangement exists, the Company’s price to the customer is fixed or determinable and collectability is reasonably assured. The Company recognizes revenues from O&M contracts, consulting services and enterprise energy management services as the related services are performed. For a limited number of contracts under which the Company receives additional revenue based on a share of energy savings, such additional revenue is recognized as energy savings are generated. As of September 30, 2017 , the Company has recorded as a reserve for future warranty obligations $2,111 . Cost of Revenues Cost of revenues include the cost of labor, materials, equipment, subcontracting and outside engineering that are required for the development and installation of projects, as well as preconstruction costs, sales incentives, associated travel, inventory obsolescence charges, amortization of intangible assets related to customer contracts and, if applicable, costs of procuring project related financing. A majority of the Company’s contracts have fixed price terms; however, in some cases the Company negotiates protections, such as a cost-plus structure, to mitigate the risk of rising prices for materials, services and equipment. Cost of revenues also include the costs of maintaining and operating the small-scale renewable energy plants that the Company owns, including the cost of fuel (if any) and depreciation charges. Income Taxes The Company provides for income taxes based on the liability method. The Company provides for deferred income taxes based on the expected future tax consequences of differences between the financial statement basis and the tax basis of assets and liabilities calculated using the enacted tax rates in effect for the year in which the differences are expected to be reflected in the tax return. The Company accounts for uncertain tax positions using a “more-likely-than-not” threshold for recognizing and resolving uncertain tax positions. The evaluation of uncertain tax positions is based on factors that include, but are not limited to, changes in tax law, the measurement of tax positions taken or expected to be taken in tax returns, the effective settlement of matters subject to audit, new audit activity and changes in facts or circumstances related to a tax position. The Company evaluates uncertain tax positions on a quarterly basis and adjusts the level of the liability to reflect any subsequent changes in the relevant facts surrounding the uncertain positions. The Company’s liabilities for uncertain tax positions can be relieved only if the contingency becomes legally extinguished through either payment to the taxing authority or the expiration of the statute of limitations, the recognition of the benefits associated with the position meet the “more-likely-than-not” threshold or the liability becomes effectively settled through the examination process. The Company considers matters to be effectively settled once the taxing authority has completed all of its required or expected examination procedures, including all appeals and administrative reviews; the Company has no plans to appeal or litigate any aspect of the tax position; and the Company believes that it is highly unlikely that the taxing authority would examine or re-examine the related tax position. The Company also accrues for potential interest and penalties related to unrecognized tax benefits in income tax expense. The Company has presented all deferred tax assets and liabilities as noncurrent on its consolidated balance sheet as of September 30, 2017 and December 31, 2016, respectively. In the first quarter of 2017, as a result of adopting ASU 2016-09, Compensation-Stock Compensation-Improvements to Employee Share-Based Payment Accounting, the Company recorded a $4,000 deferred tax asset and corresponding credit to retained earnings for excess tax benefits that had not previously been recognized because the related tax deductions had not reduced taxes payable. See Note 5 for additional information on the Company’s income taxes. Foreign Currency The local currency of the Company’s foreign operations is considered the functional currency of such operations. All assets and liabilities of the Company’s foreign operations are translated into U.S. dollars at period-end exchange rates. Income and expense items are translated at average exchange rates prevailing during the period. Translation adjustments are accumulated as a separate component of stockholders’ equity. Foreign currency translation gains and losses are reported in the consolidated statements of comprehensive income (loss). Foreign currency transaction gains and losses are reported in the consolidated statements of income. Fair Value Measurements The Company follows the guidance related to fair value measurements for all of its non-financial assets and non-financial liabilities, except for those recognized at fair value in the financial statements at least annually. These assets include goodwill and long-lived assets measured at fair value for impairment assessments, and non-financial assets and liabilities initially measured at fair value in a business combination. The Company’s financial instruments include cash and cash equivalents, restricted cash, accounts and notes receivable, long-term contract receivables, interest rate swaps, accounts payable, accrued expenses, capital lease assets and liabilities and short-term and long-term borrowings. Because of their short maturity, the carrying amounts of cash and cash equivalents, restricted cash, accounts and notes receivable, accounts payable, accrued expenses and short-term borrowings approximate fair value. The carrying value of long-term variable-rate debt approximates fair value. As of September 30, 2017 , the fair value of the Company’s long-term debt exceeds its carrying value of $202,297 by approximately $110 . Fair value of the Company’s debt is based on quoted market prices or on rates available to the Company for debt with similar terms and maturities, which are level two inputs of the fair value hierarchy, as defined in Note 7. The Company accounts for its interest rate swaps as derivative financial instruments in accordance with the related guidance. Under this guidance, derivatives are carried on the Company’s consolidated balance sheets at fair valu |