Separated some functionality in game logic.