Rewrite docment.