refine pipeline api