Moved the copy and unassociate logic to a more centralized location