Rewrite, clean-ups