Revert "deleted dead code"

This reverts commit db78acf8395d02a98f785d1a25e3eee271dce8a3.