propert directory structure and filetype detection