trim off a bit of code