def extract_categories(reader, row):
    """ Constructs list of categories out of data in row.

        Args:
            reader (CSVReader or XLSReader): object that implements
                interface for reading input data.
            row (list of values): list of values stored in a row.

        Returns:
            tuple of list of str, list of int: tuple with list of
                parsed categories and list fo column indexes where
                parsed categories were found.
    """
    categories = []
    col_indexes = []
    for col, cell in enumerate(row):
        if reader.cell_is_not_empty(cell) and reader.cell_is_not_blank(cell):
            col_indexes.append(col)
            if reader.is_valid_text(cell):
                categories.append(reader.get_cell_content(cell).strip())
            else:
                categories.append(reader.get_cell_content(cell))
    return categories, col_indexes
