def get_instructor(rec):
    """Gets instructor from a course record.

    :param record: Dictionary containing the course record.
    :returns:      TBD if instructor doesn't exist.
                   None if instructor has invalid format.
                   Instructor first name and last name if it exists.
    """
    try:
        instructor_name = rec["faculty"][0]["displayName"]
    except (KeyError, IndexError):
        return "TBD"

    instructor_name = instructor_name.split(", ", maxsplit=1)
    if len(instructor_name) < 1:
        return None

    return f"{instructor_name[1]} {instructor_name[0]}"