some rewrite in graph