extract environment to separate file