Cleaner way of determining type of media.