re-arrange some stuff
split the code a bit & more Thread methods