refactoring documentsview