refactoring get and generate list subtasks