rewrite some parts