add ut and rewrite some code
remove ut
Merge branch 'dev' of https://github.com/ecomfe/bat-ria into dev