smarter resize approach