Improve write() mutator logic.