some new functions and refactors
Signed-off-by:jasstion <zhaoyufei@edanzgroup.com>