refactoring thread settings