migrate to connect 3.x
merge with upstream