Revert "remove dead code"

This reverts commit d989bade9de32260acff2c9f00a63e662a7e6ce7.