change code style and add test cases