Update threading code;
Add threading with class method;