Refactored test class