Refactor buttonUpdate_Click () code