Separated level generation logic