Rewrite asynchronously, resolves #1, resolves #2