Compressed the threads_dict code into one shared function Removed unused imports
Compressed the threads_dict code into one shared function
Removed unused imports

knagra/farnsworth,knagra/farnsworth,knagra/farnsworth,knagra/farnsworth