Revert "delete more unused code and files"

This reverts commit 3368fe68744d686e759a6945defa94e87b2174f0.