rewrite some data structure