Avoid copying flat and never modify input flat