Added the option to give Task class from configuration