Better recalculation upon resize