added check for flagless files
more cleaning changes