refactoring in views