Refactoring Generation class (GameOfLife)