Replace nonRecursiveFlatten with native array_values function