Rewrite, clean up, speed up, etc