Refactor test_clone