Optimization for #2358