move scan_files method to Scanner.pm