Few optimization tweaks in get_pet_info() function