refactored render into game class