Refactor process_grub_config to remove duplicate code
Fix undefined method 'scan' error