add beam + refactoring with mimeType