Changed the way environments are set