def refine_search(ra: list, dec: list, oid: list, id_out: list, names: list,
    types: list) ->list:
    """ Create a final table by merging coordinates of objects found on the
    bibliographical database, with those objects which were not found.

    Parameters
    ----------
    ra: list of float
        List of RA
    dec: list of float
        List of Dec of the same size as ra.
    oid: list of str
        List of object ID (custom)
    id_out: list of str
        List of object ID returned by the xmatch with CDS
    names: list of str
        For matches, names of the celestial objects found
    types: list of str
        For matches, astronomical types of the celestial objects found

    Returns
    ----------
    out: List of Tuple
        Each tuple contains (objectId, ra, dec, name, type).
        If the object is not found in Simbad, name & type
        are marked as Unknown. In the case several objects match
        the centroid of the alert, only the closest is returned.
    """
    out = []
    for ra_in, dec_in, id_in in zip(ra, dec, oid):
        ra_in, dec_in = float(ra_in), float(dec_in)
        id_in = str(id_in)
        if id_in in id_out:
            index = id_out.index(id_in)
            out.append((id_in, ra_in, dec_in, str(names[index]), str(types[
                index])))
        else:
            out.append((id_in, ra_in, dec_in, 'Unknown', 'Unknown'))
    return out
