Restructured data pipeline. Automatically generates the codebook