Made Task generic; added an Event class