refactor work threads.