Clean up my dirty code!

I have a nested Json object and I wanted to get a variable to use in my next test … I got it working but it’s very dirty code, there must be a better way to do this?

“accountSearchResults”: [
“userAccount”: {
“userName”: “”,
“ian”: XX2001XXXX,
“firstName”: “John”,
“lastName”: “AdminUser”,
“email”: “”,
“uid”: 152253
“secondaryContact”: {
“firstName”: “secondaryContactFN”,
“lastName”: “secondaryContactLN”,
“phone”: “5550020002”
“monitoringContact”: {
“addr1”: “2 My Street”,
“addr2”: “Suite 100”,
“city”: “Blue Bell”,
“state”: “PA”,
“csid”: “XXXXX017366”
“notificationMethod”: {
“emailOrPhone”: “

I was trying to get the “uid”: 152253

My solution was

responseJson = JSON.parse(responseBody);
var list = (responseJson.accountSearchResults[0].userAccount);
var customUid = (list.uid);
pm.globals.set(“customUid”, customUid);

on the var list what ever i did then I kept getting error
Is there a cleaner way?