move trimXxxx() up to List