refactor test cases and add more interesting cases