continuation of the changes from eaaf05a7cc this further simplifies, enables this for gateway deployments as well
eaaf05a7cc