refactor update script