improve Task class

improve Task class