Refactor the clone method to decrease its cyclomatic complexity