Move the generator outside the Cave class