If then else rewriter.