optimized scratch extension