refactoring on a view