Refactored VarSizeArray class.