Revert "more unused code removal"

This reverts commit b96b2f169490adc7d6accdc2fa6da7c4c5c7c193.