Updated Task.java

Refactored