refactoring mainGame() in UI