Slight refactoring

Move the copying of task into task.java