simplify write statements