Make mergeEnvironment public