Refactoring to views