refactored logic for Game class and entities