move copy function out of fn body