refactor game class