refactored copy, move