Revert "removed more unused code..."

This reverts commit 6d0b142f37169ecbd61a10a0a84b7ef552985f12.