get rid of single-thread logic