loop less thread

fixed the unit tests after code refactoring