Rewrite based by input.