Smarter span resizing