* Do some refactor and add UT for common package. * Do some refactor and add UT for common package. * Do some refactor and add UT for common package. * Fix UT.