refactoring gamescreen code