Revert "remove some unnecessary stuff"

This reverts commit e86343b8aaa6147a0d88f7ca9439d8fddf8b6d02.
Fix some source building errors