Trimming code