Revert "Remove more dead code"

This reverts commit 8560b8c7076a306aea6dd9d2dbb53e07d69dacf6.