move game logic into own file