New merge handling and performance optimizations