we avoid creating an empty array i.e. newNode.leaves will be an array only if insertObj.leaves is defined