Large-ish rewrite