Unified logic on the same class for expand/resize.
Various changes for deeper resize function implementation