refactor GameLogic