Make inNewEnv a partial function and use it partially

Diff is best viewed with -w.