refine write