Refactor setExecutionDomain to be clearer about what it's doing and more robust.