add interface UT for RC and code refactor
Merge pull request #1216 from lyao2/ut_bs_commit3

add interface UT for RC and code refactor