Refactored unit test code organization