Updated documentation
Removed unusual thread, refactoring