move the game logic in separe file