Optimized getSpace