refactored tests and code of game class