Made TaskState sealed, subtypes case objects