share pipe/pip2 implementation