Refactored the code in the test project.