Rewrite to abstract which pipeline is used