refactored game class according to DRY principle