Revert "remove dead code"

This reverts commit 965cf98bffb132fbfa94b93ec5fd5ec09b7d24f3.