Adapted to handle task prefixes and Task.getEndTime()