gamelogic refactoring