#935 - Consolidate utility function
(cherry picked from commit 8018333)