Extract mimetype guessing into separate module