make reshapeToVectorRecursive and reshapeRecursive static