| Schedule of segment reporting information, by segment | The following tables set forth certain financial information with respect to the Company’s reportable segments (in thousands): 
|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  
| Three months ended September 30, 2020 | Infrastructure | Pressure Pumping | Sand | Drilling | All Other | Eliminations | Total |  
| Revenue from external customers | $ | 44,009 |  | $ | 15,738 |  | $ | 6,031 |  | $ | 1,193 |  | $ | 3,563 |  | $ | — |  | $ | 70,534 |  |  
| Intersegment revenues | — |  | 53 |  | — |  | 26 |  | 672 |  | (751) |  | — |  |  
| Total revenue | 44,009 |  | 15,791 |  | 6,031 |  | 1,219 |  | 4,235 |  | (751) |  | 70,534 |  |  
| Cost of revenue, exclusive of depreciation, depletion, amortization and accretion | 29,074 |  | 6,881 |  | 3,784 |  | 1,964 |  | 4,226 |  | — |  | 45,929 |  |  
| Intersegment cost of revenues | 162 |  | 449 |  | 26 |  | — |  | 114 |  | (751) |  | — |  |  
| Total cost of revenue | 29,236 |  | 7,330 |  | 3,810 |  | 1,964 |  | 4,340 |  | (751) |  | 45,929 |  |  
| Selling, general and administrative | 7,377 |  | 1,744 |  | 1,033 |  | 382 |  | 1,644 |  | — |  | 12,180 |  |  
| Depreciation, depletion, amortization and accretion | 7,589 |  | 7,196 |  | 2,693 |  | 2,323 |  | 3,331 |  | — |  | 23,132 |  |  
|  |  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  |  
| Operating loss | (193) |  | (479) |  | (1,505) |  | (3,450) |  | (5,080) |  | — |  | (10,707) |  |  
| Interest expense, net | 628 |  | 269 |  | 54 |  | 60 |  | 87 |  | — |  | 1,098 |  |  
| Other (income) expense, net | (9,204) |  | (1,156) |  | 1,792 |  | 20 |  | (494) |  | — |  | (9,042) |  |  
| Income (loss) before income taxes | $ | 8,383 |  | $ | 408 |  | $ | (3,351) |  | $ | (3,530) |  | $ | (4,673) |  | $ | — |  | $ | (2,763) |  | 
 
|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  
| Three months ended September 30, 2019 | Infrastructure | Pressure Pumping | Sand | Drilling | All Other | Eliminations | Total |  
| Revenue from external customers | $ | 37,289 |  | $ | 43,887 |  | $ | 12,634 |  | $ | 6,065 |  | $ | 13,542 |  | $ | — |  | $ | 113,417 |  |  
| Intersegment revenues | — |  | 725 |  | 5,727 |  | 58 |  | 417 |  | (6,927) |  | — |  |  
| Total revenue | 37,289 |  | 44,612 |  | 18,361 |  | 6,123 |  | 13,959 |  | (6,927) |  | 113,417 |  |  
| Cost of revenue, exclusive of depreciation, depletion, amortization and accretion | 36,940 |  | 33,059 |  | 18,547 |  | 7,203 |  | 15,385 |  | — |  | 111,134 |  |  
| Intersegment cost of revenues | — |  | 6,054 |  | 326 |  | 185 |  | 362 |  | (6,927) |  | — |  |  
| Total cost of revenue | 36,940 |  | 39,113 |  | 18,873 |  | 7,388 |  | 15,747 |  | (6,927) |  | 111,134 |  |  
| Selling, general and administrative | 7,322 |  | 3,669 |  | 1,314 |  | 910 |  | 1,208 |  | — |  | 14,423 |  |  
| Depreciation, depletion, amortization and accretion | 7,953 |  | 10,176 |  | 4,022 |  | 3,096 |  | 4,544 |  | — |  | 29,791 |  |  
| Impairment of goodwill | — |  | — |  | — |  | — |  | 3,194 |  | — |  | 3,194 |  |  
| Impairment of other long-lived assets | — |  | — |  | — |  | — |  | 3,348 |  | — |  | 3,348 |  |  
| Operating loss | (14,926) |  | (8,346) |  | (5,848) |  | (5,271) |  | (14,082) |  | — |  | (48,473) |  |  
| Interest expense, net | 599 |  | 316 |  | 43 |  | 220 |  | 220 |  | — |  | 1,398 |  |  
| Other (income) expense, net | (6,239) |  | (3) |  | 99 |  | (100) |  | (125) |  | — |  | (6,368) |  |  
| Loss before income taxes | $ | (9,286) |  | $ | (8,659) |  | $ | (5,990) |  | $ | (5,391) |  | $ | (14,177) |  | $ | — |  | $ | (43,503) |  | 
|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  
| Nine months ended September 30, 2020 | Infrastructure | Pressure Pumping | Sand | Drilling | All Other | Eliminations | Total |  
| Revenue from external customers | $ | 100,294 |  | $ | 74,549 |  | $ | 22,421 |  | $ | 7,166 |  | $ | 23,596 |  | $ | — |  | $ | 228,026 |  |  
| Intersegment revenues | — |  | 1,435 |  | 95 |  | 107 |  | 2,026 |  | (3,663) |  | — |  |  
| Total revenue | 100,294 |  | 75,984 |  | 22,516 |  | 7,273 |  | 25,622 |  | (3,663) |  | 228,026 |  |  
| Cost of revenue, exclusive of depreciation, depletion, amortization and accretion | 81,389 |  | 41,833 |  | 20,465 |  | 9,627 |  | 23,274 |  | — |  | 176,588 |  |  
| Intersegment cost of revenues | 197 |  | 1,410 |  | 355 |  | 151 |  | 1,550 |  | (3,663) |  | — |  |  
| Total cost of revenue | 81,586 |  | 43,243 |  | 20,820 |  | 9,778 |  | 24,824 |  | (3,663) |  | 176,588 |  |  
| Selling, general and administrative | 19,711 |  | 5,443 |  | 3,641 |  | 2,777 |  | 5,105 |  | — |  | 36,677 |  |  
| Depreciation, depletion, amortization and accretion | 23,339 |  | 23,373 |  | 7,353 |  | 7,900 |  | 11,165 |  | — |  | 73,130 |  |  
| Impairment of goodwill | — |  | 53,406 |  | — |  | — |  | 1,567 |  | — |  | 54,973 |  |  
| Impairment of other long-lived assets | — |  | 4,203 |  | — |  | 326 |  | 8,368 |  | — |  | 12,897 |  |  
| Operating loss | (24,342) |  | (53,684) |  | (9,298) |  | (13,508) |  | (25,407) |  | — |  | (126,239) |  |  
| Interest expense, net | 2,105 |  | 907 |  | 167 |  | 473 |  | 555 |  | — |  | 4,207 |  |  
| Other (income) expense, net | (24,289) |  | (2,444) |  | 1,753 |  | (251) |  | (490) |  | — |  | (25,721) |  |  
| Loss before income taxes | $ | (2,158) |  | $ | (52,147) |  | $ | (11,218) |  | $ | (13,730) |  | $ | (25,472) |  | $ | — |  | $ | (104,725) |  | 
 
|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  
| Nine months ended September 30, 2019 | Infrastructure | Pressure Pumping | Sand | Drilling | All Other | Eliminations | Total |  
| Revenue from external customers | $ | 187,831 |  | $ | 217,456 |  | $ | 66,820 |  | $ | 27,091 |  | $ | 58,177 |  | $ | — |  | $ | 557,375 |  |  
| Intersegment revenues | — |  | 3,936 |  | 29,795 |  | 484 |  | 1,870 |  | (36,085) |  | — |  |  
| Total revenue | 187,831 |  | 221,392 |  | 96,615 |  | 27,575 |  | 60,047 |  | (36,085) |  | 557,375 |  |  
| Cost of revenue, exclusive of depreciation, depletion, amortization and accretion | 140,768 |  | 157,106 |  | 81,475 |  | 29,030 |  | 59,841 |  | — |  | 468,220 |  |  
| Intersegment cost of revenues | 1 |  | 31,388 |  | 2,513 |  | 686 |  | 1,557 |  | (36,145) |  | — |  |  
| Total cost of revenue | 140,769 |  | 188,494 |  | 83,988 |  | 29,716 |  | 61,398 |  | (36,145) |  | 468,220 |  |  
| Selling, general and administrative | 19,874 |  | 9,544 |  | 4,214 |  | 3,117 |  | 4,464 |  | — |  | 41,213 |  |  
| Depreciation, depletion, amortization and accretion | 23,490 |  | 30,244 |  | 11,423 |  | 9,866 |  | 13,489 |  | — |  | 88,512 |  |  
| Impairment of goodwill | — |  | — |  | — |  | — |  | 3,194 |  | — |  | 3,194 |  |  
| Impairment of other long-lived assets | — |  | — |  | — |  | — |  | 3,348 |  | — |  | 3,348 |  |  
| Operating income (loss) | 3,698 |  | (6,890) |  | (3,010) |  | (15,124) |  | (25,846) |  | 60 |  | (47,112) |  |  
| Interest expense, net | 1,024 |  | 965 |  | 145 |  | 679 |  | 659 |  | — |  | 3,472 |  |  
| Other (income) expense, net | (35,108) |  | 5 |  | 67 |  | (122) |  | 214 |  | — |  | (34,944) |  |  
| Income (loss) before income taxes | $ | 37,782 |  | $ | (7,860) |  | $ | (3,222) |  | $ | (15,681) |  | $ | (26,719) |  | $ | 60 |  | $ | (15,640) |  | 
 
|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  
|  | Infrastructure | Pressure Pumping | Sand | Drilling | All Other | Eliminations | Total |  
| As of September 30, 2020: |  |  |  |  |  |  |  |  
| Total assets | $ | 414,164 |  | $ | 123,609 |  | $ | 176,577 |  | $ | 49,195 |  | $ | 114,158 |  | $ | (46,604) |  | $ | 831,099 |  |  
| As of December 31, 2019: |  |  |  |  |  |  |  |  
| Total assets | $ | 420,285 |  | $ | 175,259 |  | $ | 190,382 |  | $ | 61,545 |  | $ | 142,731 |  | $ | (37,817) |  | $ | 952,385 |  |  |