copy refactor