moved copy fcts to separate file