refactor update thread