Simpler filetype detection