multi-threading improvements