Capital expenditures. During the six months ended June 30, 2023, our capital expenditures were $82.4 million primarily related to $45.5 million for the Arkansas manufacturing facility, $10.6 million in cost reduction initiatives, $9.6 million for our new corporate headquarters, $2.4 million in capacity expansion in our existing facilities, and $3.6 million for safety, environmental and general support.
Repurchases of common shares. During the six months ended June 30, 2023, we repurchased 264,896 shares of our outstanding common stock under the 2023 Stock Repurchase Program.
RESULTS OF OPERATIONS
General. Our results of operations are affected by a number of factors, including, but not limited to, the cost to manufacture and distribute products, cost of raw materials, inflation, interest rates, consumer spending and preferences, the impact of any supply chain disruptions, economic conditions, and any adverse effects from global health pandemics and geopolitical conflicts.
Sale of Substantially All of the Assets of Trex Commercial Products, Inc. On December 30, 2022, we completed the sale of substantially all of the assets of our wholly-owned subsidiary and reportable segment, Trex Commercial, for net proceeds of $7.3 million. The divestiture of Trex Commercial reflects our decision to focus on driving the most profitable growth strategy for the Company and its shareholders through the execution of our outdoor living strategy. With the sale complete, we will dedicate our resources to accelerating conversion to composites from wood and further strengthen our leadership position in the outdoor living category. The divestiture did not represent a strategic shift with a major effect on the Company’s operations and financial results. As such, the results of operations of Trex Commercial are consolidated in the Company’s results of operations for the three months and six months ended June 30, 2022.
Russian / Ukraine Conflict. The conflict between Russia and Ukraine has not directly affected our business and results of operations. We have no operations or direct sales in Russia or Ukraine but continue to monitor the potential economic impact of the conflict on supply chains, commodity and fuel prices, and prices of raw materials. We cannot predict the impact of the continued conflict on the global economy, our industry or our business.
Net Sales. Net sales consist of sales and freight, net of discounts. The level of net sales is principally affected by sales volume and the prices paid for Trex products. Trex Residential operating results have historically varied from quarter to quarter. Seasonal, erratic or prolonged adverse weather conditions in certain geographic regions reduce the level of home and commercial improvement and residential and commercial construction and can shift demand for our products to a later period. As part of our normal business practice and consistent with industry practice, we have historically provided our distributors and dealers of our Trex Residential products incentives to build inventory levels before the start of the prime deck-building season to ensure adequate availability of our product to meet anticipated seasonal consumer demand and to enable production planning. These incentives include payment discounts, favorable payment terms, price discounts, or volume rebates on specified products and other incentives based on increases in purchases as part of specific promotional programs. The timing of our incentive programs can significantly impact sales, receivables and inventory levels during the offering period.
Gross Profit. Gross profit represents the difference between net sales and cost of sales. Cost of sales consists of raw material costs, direct labor costs, manufacturing costs, subcontract costs and freight. Raw material costs generally include the costs to purchase and transport reclaimed wood fiber, reclaimed polyethylene, pigmentation for coloring our products, and commodities used in the production of railing and staging. Direct labor costs include wages and benefits of personnel engaged in the manufacturing process. Manufacturing costs consist of costs of depreciation, utilities, maintenance supplies and repairs, indirect labor, including wages and benefits, and warehouse and equipment rental activities.
Selling, General and Administrative Expenses. The largest component of selling, general and administrative expenses is personnel related costs, which includes salaries, commissions, incentive compensation, and benefits of personnel engaged in sales and marketing, accounting, information technology, corporate operations, research and development, and other business functions. Another component of selling, general and administrative expenses is branding and other sales and marketing costs, which are used to build brand awareness. These costs consist primarily of advertising, merchandising, and other promotional costs. Other general and administrative expenses include professional fees, office occupancy costs attributable to the business functions previously referenced, and consumer relations expenses. As a percentage of net sales, selling, general and administrative expenses may vary from quarter to quarter due, in part, to the seasonality of our business.
Below is the discussion and analysis of our operating results and material changes in our operating results for the three months ended June 30, 2023 (2023 quarter) compared to the three months ended June 30, 2022 (2022 quarter), and for the six months ended June 30, 2023 (2023 six-month period) compared to the six months ended June 30, 2022 (2022 six-month period).
22