nit: else if (thread)