Refactored into data generate and apply