renamed MimeFilter to TypeFilter, minor refactoring as well.