Revert "Revert "simplified write""

This reverts commit dbdeecc8244787afb2172da72fce5cab43abccab.
+