this could be simplified to just `File.file?(file)` as it will also return false if the file doesn't exist. (Since it's still not a file in that case)