extracting out environment code
merging