Refactoring, add deep cloning