Refactor copy task