def remove_unwanted(doc):
    """Remove attributes unecessary to superdesk from documents.

    As the name suggests this function removes unwanted attributes from doc to make an entry in Mongo and Elastic.
    """
    if doc:
        for attr in ['_type', 'desk', 'archived']:
            if attr in doc:
                del doc[attr]
