Optimizations for resizing modal