refactor update.