Move env code part 2

Only just noticed I committed this on the wrong branch.