Moved GenerationHelper function