moved copy functions to util.py