Simplify copy function