Better way of retrieving object field values