Avoid recursive calls to getTrimValue