refactored clone method