Minor refactor to #14147 patch (#14147)

Change-Id: I78cdbbad41fa6980f445ae770f7e7a8d7db39176