more refactoring of the view