Refactored test case