Optimized clone method
Fixed code style