Refactored test case a bit