Revert "remove dead code"

This reverts commit fb99759e023463d9bc41f27882ae61786fd3ad68.