extracted data generator into standalone function
refactored data generator