Now handles multi-threading through environment cloning