import re


def _name_formatter(name):
    """
    Clean up names of spurious formatting (extra spaces, some special characters)

    Parameters
    ----------
    name : str
        Name to clean up

    Returns
    -------
    Cleaned up name
    """

    # Clean up multiple spaces
    name = re.sub(r"\s\s+", " ", name)

    # Clean up Simbad types
    strings_to_delete = ['V* ', 'EM* ', 'NAME ', '** ', 'Cl* ', '* ']
    for pattern in strings_to_delete:
        name = name.replace(pattern, '')

    name = name.strip()

    # Clean up 'hidden' names from Simbad
    if 'HIDDEN' in name.upper():
        name = None

    return name