Added method to get the thread.
Added configs
Little refactoring