Refactored unit test class