Refactoring: Separated UI logic from player logic.