Optimize shell resizing