def get_index_with_default(header, column_name, default_value=None):
    """Helper function to extract the index of a column."""
    return header.index(column_name) if column_name in header else default_value