refactor dynamic pipeline