Remove unused global variable and update function return type

Change-Id: I2f6e0388c2d1218e72b70a69b429884b39dc096f