clean structure before update