factored out media type specific implementation details to separate
classes (more code but slightly saner approach)