Cleaning up Codebook