Cleaner way for on resize