refactored to use node mime-types module