Improvements/new implementation for Cloud-TM branch

I'll send an email about it.