Improving the internals

* More logging
* Rewrote the clone function and the calling code.