Improve codebook formatting