add a factory for tasks instead of loading classes from name