Refactored entire task.