update code style and fix broken test cases

@zhangcheng please help to review it , thanks a lot