core task generation refactoring