intermediary rewrite