better and cleaner merging of environments