refactoring game grid