Minor changes in thread organization