Revert "removed more unnecessary code"

This reverts commit 3fee88035f7589684f6f71a2c38a3c96ec754436.