rewrite certain parts