move ext and mime type to config method