Improve write.tidy