rewrite the RefTR pipeline with sjm