complete rewrite, new thread module