refactor for threading