Cleanup, rewrite.