Moved env setup back to core