Better theme detection