Separate the game logic from the main app.