Moved logic to handle necessary population of environment data to function that introduces data from backend

GCP-9894

Code review : Daniel Jao