Refactored remote file reading into a separate method in remote scan