Revert "move some things to d2-common"

This reverts commit 789ac5c231de1ff7856e24a7c96b79952c65a185.