Rewrite gem pipeline