Rewriting from the ground-up to be more flexible