modified and refactored CreateViewFile, modified UpdateContentType