An observation: `create_subtasks_ids` and `general_items_for_subtask` have some overlapping functionality (even some common code). I suggest changing how the functions are called re-factoring the common functionality out.

One possibility (on top of my head), generate items first, then assign subtask_ids based on those items.