More refactoring to split the scan process from the view logic