Lot of tweaks to improve multithreading and streaming