Refactor of test cases