Files.write could be used instead