Refactor out _decode_values helper function