Refactored the test class.