Revert "Remove unecessary dave code"

This reverts commit 23376eaf5749ac6fc6526207bf1aab48c2d3b0e7.