I saw a lot of repeated code.
https://github.com/brianchandotcom/liferay-portal-ee/pull/23700
made me make
https://github.com/liferay/liferay-portal/commit/03a34bf5346958d8d6ada6f3123849cac92c3ee0
and
https://github.com/liferay/liferay-portal/commit/4576487848ce35ac48b8dc8af060c15f52640ef7