unify writing of multi-part and single-part data