some improvements of the rewrite pannel