The TaskView class can dismiss itself, so remove all unrelated codes from other classes