renaming variables and template argument, remove the n_thread struct