refactored threading project