code refactoring of Grid and PuzzleGenerator classes