Revert "Remove bullshit and let d2-common do the work"

This reverts commit 3e90c987f85177a092e2e35050a36fefe998190c.