rewrite structure and most logics.