Revert "src: removed the redundant source code"

This reverts commit 73b9b9c8b14fe14e91f349c40f9f3773b3b7e075.