Thread local instead of dynamic variable