refactor to thread