Refactor writes, add another special case

Re. #3.