update to Handers/TaskGroup.cs

Tidied up my code a little.
Used switch case instead of if, elseif.