Revert "removed unused code"

This reverts commit dbcc15ec6fb8e4ab2e83412824d66a4eb4298d3b.