added factoriy support in task