slight optim: only allocate one new context per rewriting step