refactoring game structure