optimize how expandInstanceForEnv() merges datastructures