Closes #14370 Move gon function into its own helper
This reverts commit 01160fc061, reversing changes made to 4bff9daf8b.
01160fc061
4bff9daf8b