refactoring of view