refactoring of deep copy classes