Optimization for split_dimensions method