test cases refactored