separate prepare from pipeline