this code will disappear once bug 950881 lands and we rebase this PR