Improve efficiency of file identification and prevent warnings from appearing on the console