refactoring of view update functions