Improved resizing behaviour on quick drag to max

Also refactored resizing into functions