Refined trimming functionaity