Optimized performance for space removing.