remove thread dependency, add stack tests