Revert "removed outdated code"

This reverts commit d0b9d79524e92addc11a1a74f68b0711ca2ff8a3.
code cleanup