Refactored the test data generator