modularized for multithreading