refactoring
more test cases