replace SimpleHandshake with DynamicPipe, cleanup