Fix data races, simplify