function copying, part of decorator