[base] TokenShaper: some improvements