basic code for destroy task factory