Trimming with cloning code