Refactor reactor->write