clustering implementation bugs fixes and memory optimizations.
threads destroy optimizations.