rewrite fixes