move filetype detection