refactoring updateView