refactored test case