port some changes forward for rebasing