Revert "Remove unused code"

This reverts commit b52e8e5e4cc68054b5b317304cb5d6d0b1f4d5d2.
Remove unused code 2nd try