Refactored threads to remove async.