Optimize Quarry mode and Flatten mode initialization