Modified  to use new MimeTypes class.