Resize logic out of Main