refactoring game class